APIs & Integrations

yorambaron
Teilnehmer/-in

How to list the metadata for all files?

lösung

I am trying to set the offset parameter in the following API call:

https://api.hubapi.com/filemanager/api/v2/files?hapikey=<key>?offset=2

 

For some reason the API returned with the following error:

{"status":"error","message":"This hapikey (<key>?offset=2) doesn't exist.","correlationId":"<value>","requestId":"<value>"}

It looks like the API does not support the offset parameter in the GET command or I am missing something, can you help?

0 Upvotes
1 Akzeptierte Lösung
lscanlan
Lösung
HubSpot-Alumnus/Alumna
HubSpot-Alumnus/Alumna

How to list the metadata for all files?

lösung

Hi @yorambaron,

 

Is that a copy/paste of the request URL you're using (minus the hapikey)? The reason I ask is because the URL you've pasted above actually has 2 ?s for query strings. So our server is reading the hapikey as <key>?offset=2 , which obviously is not correct. I assume it's just a typo, but you'll want to separate those query string parameters with ampersands instead of question marks. So your request URL should look more like this:

 

https://api.hubapi.com/filemanager/api/v2/files?hapikey=<key>&offset=20

Could you try that and let me know if it works? Also, I would strongly recommend deactivating your API key and generating a new one. The text of the link above in your post contained just <key> . But the actual link contained the key itself. I've removed it for you, but that key should be considered compromised now.

 

Let me know if you have any questions.

 

Leland Scanlan

HubSpot Developer Support

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
3 Antworten
lscanlan
Lösung
HubSpot-Alumnus/Alumna
HubSpot-Alumnus/Alumna

How to list the metadata for all files?

lösung

Hi @yorambaron,

 

Is that a copy/paste of the request URL you're using (minus the hapikey)? The reason I ask is because the URL you've pasted above actually has 2 ?s for query strings. So our server is reading the hapikey as <key>?offset=2 , which obviously is not correct. I assume it's just a typo, but you'll want to separate those query string parameters with ampersands instead of question marks. So your request URL should look more like this:

 

https://api.hubapi.com/filemanager/api/v2/files?hapikey=<key>&offset=20

Could you try that and let me know if it works? Also, I would strongly recommend deactivating your API key and generating a new one. The text of the link above in your post contained just <key> . But the actual link contained the key itself. I've removed it for you, but that key should be considered compromised now.

 

Let me know if you have any questions.

 

Leland Scanlan

HubSpot Developer Support
0 Upvotes
yorambaron
Teilnehmer/-in

How to list the metadata for all files?

lösung

Thanks a so much, I had a typo error in the URL , the problem is resolved.

How do you recreate the API key? 

0 Upvotes
yorambaron
Teilnehmer/-in

How to list the metadata for all files?

lösung

I found how to recreate the API key, thank you!