Commerce Tools

RSPerera1
Member

Getting Quotes file size

SOLVE

Hi,

I have a requirement to download the quotes via API. For that im using batch read endpoint and get the hs_download_link to download the quote. But I need to get the file_size for that paticular file. How can i do that?

Also is there any way to get the published quote attachment id? If so then we can use it to get the file related details.

 

Thank you

0 Upvotes
1 Accepted solution
PamCotton
Solution
HubSpot Alumni
HubSpot Alumni

Getting Quotes file size

SOLVE

Hey @RSPerera1, A HEAD request to hs_download_link should have minimal impact on your HubSpot API rate limits, as it doesn’t retrieve the full response body.

 

 However, it still counts as an API call, so if you're making frequent requests, it's good to monitor usage. 

 

You can check HubSpot’s API rate limits in your developer settings to ensure sustainability.

 

Pam

View solution in original post

0 Upvotes
3 Replies 3
PamCotton
HubSpot Alumni
HubSpot Alumni

Getting Quotes file size

SOLVE

Hey @RSPerera1, thank you for posting in our Community!

 

To get the file size for a quote, you can make a HEAD request to the hs_download_link. The Content-Length header in the response will provide the file size in bytes without requiring you to download the file.

Regarding the published quote attachment ID, it isn’t directly available via the Quotes API. You might need to explore related objects or associations through the CRM API to retrieve additional details.

 

To our top experts @Anton and @DanielSanchez do you have any recommendations for @RSPerera1 matter?

 

Thank you,

Pam

0 Upvotes
RSPerera1
Member

Getting Quotes file size

SOLVE

Hi @PamCotton 

Thank you for the response.

 

I just have one concern—will making a HEAD request to the hs_download_link impact the API rate limits in HubSpot? Understanding this will help me ensure the method is both efficient and sustainable.

 

Looking forward to your insights!

Best regards,

Ravidu

0 Upvotes
PamCotton
Solution
HubSpot Alumni
HubSpot Alumni

Getting Quotes file size

SOLVE

Hey @RSPerera1, A HEAD request to hs_download_link should have minimal impact on your HubSpot API rate limits, as it doesn’t retrieve the full response body.

 

 However, it still counts as an API call, so if you're making frequent requests, it's good to monitor usage. 

 

You can check HubSpot’s API rate limits in your developer settings to ensure sustainability.

 

Pam

0 Upvotes