APIs & Integrations

Johannes-mue
Member

ID ranges

SOLVE

Hi,

 

What are the ID ranges used in the API? I need to know in order to find the correct type to handle them in our integration. Please mention a general range in the form [start,end], and possible exceptions if there are any.

 

Thanks

0 Upvotes
1 Accepted solution
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

ID ranges

SOLVE

Hey @Johannes-mue,

 

There are a number of different types of ID that HubSpot uses in different tools. Some tools like forms use GUIDs, like the old example from my account below. There is no hard range on a GUID like this, but they'll all generally follow the same format.

 

Object records have numeric IDs, and these are stored in memory as 64 bit unsigned integers. While technically you're correct that the current full range of object IDs is between 1 and (2^64) -1, in reality the highest existing object ID is significant lower. Portal IDs are the same, except the highest portal ID is even lower, given that each portal can have many objects.

 

I'm not 100% sure what specifically you're looking to do: If you have any other questions and/or details on what your goal is, I'd be happy to keep digging into this with you.

View solution in original post

3 Replies 3
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

ID ranges

SOLVE

If you're referring to object IDs, for practical purposes we use 64-bit unsigned integers, so something like a Java long should allow you to store any object IDs.

 

If you're referring to some other IDs, can you clarify which they are?

0 Upvotes
Johannes-mue
Member

ID ranges

SOLVE

Hi Derek,

 

Well, I am interested in all IDs that you expose in the API really. Are there other IDs I need to consider that have a different format? Maybe the portal id is a non object ID? I explicitly asked for a specific range rather than a datatype, so that I can better validate them; So is the ID range actually [0,18446744073709551615], or rather [1,18446744073709551615]?

 

Regards,

Johanens M.

0 Upvotes
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

ID ranges

SOLVE

Hey @Johannes-mue,

 

There are a number of different types of ID that HubSpot uses in different tools. Some tools like forms use GUIDs, like the old example from my account below. There is no hard range on a GUID like this, but they'll all generally follow the same format.

 

Object records have numeric IDs, and these are stored in memory as 64 bit unsigned integers. While technically you're correct that the current full range of object IDs is between 1 and (2^64) -1, in reality the highest existing object ID is significant lower. Portal IDs are the same, except the highest portal ID is even lower, given that each portal can have many objects.

 

I'm not 100% sure what specifically you're looking to do: If you have any other questions and/or details on what your goal is, I'd be happy to keep digging into this with you.