# getSignedUrl causing a 404 error

**URL:** <https://community.hubspot.com/t/getsignedurl-causing-a-404-error/115293>\
**Category:** APIs & Integrations\
**Tags:** object\
**Created:** [August 27, 2024, 2:24pm UTC](https://community.hubspot.com/t/getsignedurl-causing-a-404-error/115293 "2024-08-27T14:24:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HFarhat8](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@HFarhat8](https://community.hubspot.com/u/HFarhat8)\
**Post date:** [August 27, 2024, 2:24pm UTC](https://community.hubspot.com/t/getsignedurl-causing-a-404-error/115293/1 "2024-08-27T14:24:34Z")

</div>

Hi everyone,  
We recently experienced a problem with your Node JS API and we need help with resolving the issue.

The following line:

const apiResponse = await hubspotClient.files.filesApi.getSignedUrl(fileId, size, expirationSeconds, upscale);

is working fine for documents not marked as sensitive. However, for the ones marked as sensitive, it’s causing the following error to occur:

ApiException [Error]: HTTP-Code: 404

The filed is 112892509882 and the rest of the parameters are set to “undefined”.

Here’s the full response we get back:

file id 112892509882  
error getSignedUrl ApiException [Error]: HTTP-Code: 404  
Message: An error occurred.  
Body: “\<html\>\n\<head\>\n\<meta http-equiv=\“Content-Type\” content=\“text/html;charset=utf-8\”/\>\n\<title\>Error 404 Not Found\</title\>\n\</head\>\n\<body\>\<h2\>HTTP ERROR 404\</h2\>\n\<p\>Resource not found\</p\>\n\</body\>\n\</html\>\n”  
Headers: {“access-control-allow-credentials”:“false”,“cache-control”:“must-revalidate,no-cache,no-store”,“cf-cache-status”:“DYNAMIC”,“cf-ray”:“8b739e73c8316515-LHR”,“connection”:“close”,“content-encoding”:“gzip”,“content-type”:“text/html;charset=iso-8859-1”,“date”:“Thu, 22 Aug 2024 14:40:36 GMT”,“nel”:“{\“success\_fraction\”:0.01,\“report\_to\”:\“cf-nel\”,\“max\_age\”:604800}”,“report-to”:“{\“endpoints\”:[{\“url\”:\“https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=WFP8uu1WGKuYqMoux6KOeE2OguY%2FkhMF%2BEhadEhzXLnWx9AWXVIwrK8I6zce3E0IXBwzAd3uTRxY2MLLjjDyYGtNY7mR0g1wqma92GVZnLSr2aSWl42nCIcvOpNmpr0O\”}],\“group\”:\“cf-nel\”,\“max\_age\”:604800}”,“server”:“cloudflare”,“strict-transport-security”:“max-age=31536000; includeSubDomains; preload”,“transfer-encoding”:“chunked”,“vary”:“origin, Accept-Encoding”,“x-content-type-options”:“nosniff”,“x-envoy-upstream-service-time”:“10”,“x-evy-trace-listener”:“listener\_https”,“x-evy-trace-route-configuration”:“listener\_https/all”,“x-evy-trace-route-service-name”:“envoyset-translator”,“x-evy-trace-served-by-pod”:“fra04/hubapi-td/envoy-proxy-576d445cf9-bhvbv”,“x-evy-trace-virtual-host”:“all”,“x-hubspot-correlation-id”:“93291384-f16d-445f-bec9-116d062f4908”,“x-hubspot-notfound”:“true”,“x-hubspot-ratelimit-daily”:“1000000”,“x-hubspot-ratelimit-daily-remaining”:“994333”,“x-hubspot-ratelimit-interval-milliseconds”:“10000”,“x-hubspot-ratelimit-max”:“190”,“x-hubspot-ratelimit-remaining”:“186”,“x-hubspot-ratelimit-secondly”:“19”,“x-hubspot-ratelimit-secondly-remaining”:“18”,“x-request-id”:“93291384-f16d-445f-bec9-116d062f4908”}  
at FilesApiResponseProcessor.\<anonymous\> (/Users/hadi/Sites/hubspot-isams-sync/node\_modules/@hubspot/api-client/codegen/files/apis/FilesApi.ts:990:19)  
at Generator.next (\<anonymous\>)  
at fulfilled (/Users/hadi/Sites/hubspot-isams-sync/node\_modules/@hubspot/api-client/lib/codegen/files/apis/FilesApi.js:5:58)  
at processTicksAndRejections (node:internal/process/task\_queues:95:5) {  
code: 404,  
body: ‘\<html\>\n’ +  
‘\<head\>\n’ +  
‘\<meta http-equiv=“Content-Type” content=“text/html;charset=utf-8”/\>\n’ +  
‘\<title\>Error 404 Not Found\</title\>\n’ +  
‘\</head\>\n’ +  
‘\<body\>\<h2\>HTTP ERROR 404\</h2\>\n’ +  
‘\<p\>Resource not found\</p\>\n’ +  
‘\</body\>\n’ +  
‘\</html\>\n’,  
headers: {  
‘access-control-allow-credentials’: ‘false’,  
‘cache-control’: ‘must-revalidate,no-cache,no-store’,  
‘cf-cache-status’: ‘DYNAMIC’,  
‘cf-ray’: ‘8b739e73c8316515-LHR’,  
connection: ‘close’,  
‘content-encoding’: ‘gzip’,  
‘content-type’: ‘text/html;charset=iso-8859-1’,  
date: ‘Thu, 22 Aug 2024 14:40:36 GMT’,  
nel: ‘{“success\_fraction”:0.01,“report\_to”:“cf-nel”,“max\_age”:604800}’,  
‘report-to’: ‘{“endpoints”:[{“url”:“https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=WFP8uu1WGKuYqMoux6KOeE2OguY%2FkhMF%2BEhadEhzXLnWx9AWXVIwrK8I6zce3E0IXBwzAd3uTRxY2MLLjjDyYGtNY7mR0g1wqma92GVZnLSr2aSWl42nCIcvOpNmpr0O”}],“group”:“cf-nel”,“max\_age”:604800}’,  
server: ‘cloudflare’,  
‘strict-transport-security’: ‘max-age=31536000; includeSubDomains; preload’,  
‘transfer-encoding’: ‘chunked’,  
vary: ‘origin, Accept-Encoding’,  
‘x-content-type-options’: ‘nosniff’,  
‘x-envoy-upstream-service-time’: ‘10’,  
‘x-evy-trace-listener’: ‘listener\_https’,  
‘x-evy-trace-route-configuration’: ‘listener\_https/all’,  
‘x-evy-trace-route-service-name’: ‘envoyset-translator’,  
‘x-evy-trace-served-by-pod’: ‘fra04/hubapi-td/envoy-proxy-576d445cf9-bhvbv’,  
‘x-evy-trace-virtual-host’: ‘all’,  
‘x-hubspot-correlation-id’: ‘93291384-f16d-445f-bec9-116d062f4908’,  
‘x-hubspot-notfound’: ‘true’,  
‘x-hubspot-ratelimit-daily’: ‘1000000’,  
‘x-hubspot-ratelimit-daily-remaining’: ‘994333’,  
‘x-hubspot-ratelimit-interval-milliseconds’: ‘10000’,  
‘x-hubspot-ratelimit-max’: ‘190’,  
‘x-hubspot-ratelimit-remaining’: ‘186’,  
‘x-hubspot-ratelimit-secondly’: ‘19’,  
‘x-hubspot-ratelimit-secondly-remaining’: ‘18’,  
‘x-request-id’: ‘93291384-f16d-445f-bec9-116d062f4908’  
}  
}

---

<div class="post-metadata">

**Author:** ![SteveHTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stevehtm/32/22074_2.png) [@SteveHTM](https://community.hubspot.com/u/SteveHTM)\
**Post date:** [August 27, 2024, 2:48pm UTC](https://community.hubspot.com/t/getsignedurl-causing-a-404-error/115293/2 "2024-08-27T14:48:05Z")

</div>

@HFarhat8 - check your private app scopes permit access to hidden files. The error message for the private files access leaves a lot to be desired!

Steve

---

<div class="post-metadata">

**Author:** ![HFarhat8](https://avatars.discourse-cdn.com/v4/letter/h/ec9cab/32.png) [@HFarhat8](https://community.hubspot.com/u/HFarhat8)\
**Post date:** [August 27, 2024, 2:51pm UTC](https://community.hubspot.com/t/getsignedurl-causing-a-404-error/115293/3 "2024-08-27T14:51:16Z")

</div>

Hi Steve, thank you for your reply. Do you know exactly which scopes should be enabled?

---

<div class="post-metadata">

**Author:** ![SteveHTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stevehtm/32/22074_2.png) [@SteveHTM](https://community.hubspot.com/u/SteveHTM)\
**Post date:** [August 27, 2024, 2:56pm UTC](https://community.hubspot.com/t/getsignedurl-causing-a-404-error/115293/4 "2024-08-27T14:56:01Z")

</div>

I would have offered a screen shot, but HubSpot is down right now 🙂

If you search in scopes for ‘file’ you will see it pretty fast.

Steve
