How to list the metadata for all files?

SOLVE
Regular Contributor

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?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
HubSpot Moderator

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
Reply
0 Upvotes
3 Replies 3
Highlighted
HubSpot Moderator

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
Reply
0 Upvotes
Highlighted
Regular Contributor

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

How do you recreate the API key? 

Reply
0 Upvotes
Highlighted
Regular Contributor

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