Subscription list Timeline

I am trying to get the current subscription list to make a list of users who want to unsubscribe. The demo API is the one below:

https://api.hubapi.com/email/public/v1/subscriptions/timeline?hapikey=demo

However, I could not make sure up to which time ago it lists the items. Say, if I hit the link at 17:00 hours, then up to what time back this list is being populated.

Then again, if I hit the link at 23:00 hours, will it give me a list for a different time-span? Is it like per day? Is there any other parameter to tweak the time span? Is it relative to different time zones, e..g: GMT, AEST etc.?

Thank you in advance.

Hi @MShams

You will want to use the startTimestamp=X and the endTimestamp=X parameters in your call. You can see a full list here.

The time needs to be set using a Unix timestamp in milliseconds. Unix timestamps are time zone independent so do not worry about that part.

Thank you Dennisedson,

I tried to add the parameters and make the call. In response it said it expects an offset from the previous call. Then I called again without any parameters but only the api key ‘demo’. It returned an offset at this time. Then I added the offset to the actual call with other parameters and it returned the inteded list.

The question is, is it the right way (getting offset value without other parameters, then adding that parameter with the actual call) to obtain the subscription list for a given timespan? It looks like the first call without any parameters obtains a key (offset), which is to add to the second call so that it opens the door of the subscription list for a given timespan. Is that the way it is, or am I making any mistake?

Best regards,

Mehedi

@MShams ,

Looks like you got it :+1: