# Error 404 retrieve Form uploaded file

**URL:** <https://community.hubspot.com/t/error-404-retrieve-form-uploaded-file/100485>\
**Category:** APIs & Integrations\
**Tags:** developer-tools, forms\
**Created:** [February 19, 2024, 5:10pm UTC](https://community.hubspot.com/t/error-404-retrieve-form-uploaded-file/100485 "2024-02-19T17:10:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AMoulin](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@AMoulin](https://community.hubspot.com/u/AMoulin)\
**Post date:** [February 19, 2024, 5:10pm UTC](https://community.hubspot.com/t/error-404-retrieve-form-uploaded-file/100485/1 "2024-02-19T17:10:13Z")

</div>

Hi,

I created a form with a form field and I’m using api to retrieve submissions of that form.

When I try to use the url given by the submission to download the file using API token it returns a 404 error, but when I open the url in a browser (while being authenticated) it correctly shows the file.

I put in scopes for the app :

- forms
- forms-uploaded-files
- files.ui\_hidden.read
- files

I expect ony the two first scopes should be necessary.

Am I missing something ?

---

<div class="post-metadata">

**Author:** ![Humashankar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/humashankar/32/30856_2.png) [@Humashankar](https://community.hubspot.com/u/Humashankar)\
**Post date:** [February 20, 2024, 12:28am UTC](https://community.hubspot.com/t/error-404-retrieve-form-uploaded-file/100485/2 "2024-02-20T00:28:57Z")

</div>

This may be because of token has no sufficient permissions to access files uploaded via forms

---

<div class="post-metadata">

**Author:** ![AMoulin](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@AMoulin](https://community.hubspot.com/u/AMoulin)\
**Post date:** [February 20, 2024, 10:35am UTC](https://community.hubspot.com/t/error-404-retrieve-form-uploaded-file/100485/3 "2024-02-20T10:35:11Z")

</div>

where theses permissions are configured ? I mean I’m confused, it’s an app, it should have access to all by default, restriced by the scopes at most.

---

<div class="post-metadata">

**Author:** ![dsmarion](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dsmarion/32/7509_2.png) [@dsmarion](https://community.hubspot.com/u/dsmarion)\
**Post date:** [February 20, 2024, 12:55pm UTC](https://community.hubspot.com/t/error-404-retrieve-form-uploaded-file/100485/4 "2024-02-20T12:55:31Z")

</div>

Hmmm… 404 means not found, it’s not a permissions issue. That would be 401 or 403. Can you show more info about your api call? I am guessing something else is the culprit.

---

<div class="post-metadata">

**Author:** ![AMoulin](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@AMoulin](https://community.hubspot.com/u/AMoulin)\
**Post date:** [February 20, 2024, 1:28pm UTC](https://community.hubspot.com/t/error-404-retrieve-form-uploaded-file/100485/5 "2024-02-20T13:28:01Z")

</div>

basically it’s that :

```auto
 $headers = [
 'Authorization' => "Bearer {$this->accessToken}",
 'Content-Type' => 'application/json',
 ];
 $response = (new ExternalResourceClient())->request('GET', $url, null, $headers);

```

the URL is exactly the one recieved while retrieving the submission from the api calls, it looks like that :

`https://api-na1.hubspot.com/form-integrations/v1/uploaded-files/signed-url-redirect/XXXXX?portalId=XXXX&sign=XXX&conversionId=XXX&filename=XXX.pdf`

the same code works to retrieve submissions

the same url works on browser to get the file

I’m thinking i did not try without the content-type, might cause some issues

---

<div class="post-metadata">

**Author:** ![dsmarion](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dsmarion/32/7509_2.png) [@dsmarion](https://community.hubspot.com/u/dsmarion)\
**Post date:** [February 20, 2024, 1:39pm UTC](https://community.hubspot.com/t/error-404-retrieve-form-uploaded-file/100485/6 "2024-02-20T13:39:03Z")

</div>

Maybe. Also not sure if you need to urlencode. I have not used this endpoint so can’t give any examples or help much further. Maybe some else will chime in..

---

<div class="post-metadata">

**Author:** ![AMoulin](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@AMoulin](https://community.hubspot.com/u/AMoulin)\
**Post date:** [February 20, 2024, 4:24pm UTC](https://community.hubspot.com/t/error-404-retrieve-form-uploaded-file/100485/7 "2024-02-20T16:24:27Z")

</div>

tried without the content-type, did not change anything

---

<div class="post-metadata">

**Author:** ![AMoulin](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@AMoulin](https://community.hubspot.com/u/AMoulin)\
**Post date:** [March 1, 2024, 3:31pm UTC](https://community.hubspot.com/t/error-404-retrieve-form-uploaded-file/100485/8 "2024-03-01T15:31:39Z")

</div>

We found that the issue came from the request client class used in our framework. This class is trying to follow itself the redirections to make the requests using final IP address instead of domain name, and it seems that at some point it looses some requested data.
