API issue - Activities

Level 1

API issue - Activities

API concerned : get /rest/v1/activities.json (Get Lead Activities)

Implementation Notes

Returns a list of activities from after a datetime given by the nextPageToken parameter. Also allows for filtering by lead static list membership, or by a list of up to 30 lead ids. Required Permissions: Read-Only Activity, Read-Write Activity)

Strange Behaviour description

I receive erratic results, when I am  asking this API in the following conditions:

- generated access-token up to date

- fixed leadIDs ( just one integer passed as value to this parameter )

- fixed activityTypeIds ( just one integer passed as value to this parameter )

- fixed batchSize fixed to 300

- Iterative requests are placed on a 6 month period -with 1 month hops- in varying the "sinceDateTime" before generating a nextPageToken.

1a) Initial sinceDateTime = 2019-01-01T00:00:00-00:00

2a) to the get /rest/v1/activities/pagingtoken.json in order to get a first valid nextPageToken with 'sinceDatetime' set

3a) to the: get /rest/v1/activities.json (Get Lead Activities), each time  using the returned 'nextPageToken' to get the next bunch of values

results --> from 2019-01-xx to 2019-03-xx

(..b..)  next sinceDateTime = 2019-02-01T00:00:00-00:00 as (1b), followed by (2b, 3b) steps

results --> from 2019-02-xx to 2019-03-xx

(..c..)  next sinceDateTime = 2019-03-01T00:00:00-00:00 as (1c), followed by (2c, 3c) steps

results --> from 2019-03-xx to 2019-04-xx

(..d..)  next sinceDateTime = 2019-04-01T00:00:00-00:00 as (1d), followed by (2d, 3d) steps

results --> from 2019-04-xx to 2019-04-xx

(..e..)  next sinceDateTime = 2019-05-01T00:00:00-00:00 as (1e), followed by (2e, 3e) steps

results --> from 2019-05-xx to 2019-05-xx

(..f..)  next sinceDateTime = 2019-06-01T00:00:00-00:00 as (1f), followed by (2f, 3f) steps

results --> from 2019-06-xx to 2019-06-xx

Question: since the documentation (se below implementation note) refers only to a temporal "start marker", why do this API returns data in a period range where the "stop markers" are different ? Is there any special issue to specify it ?

Pascal

7 REPLIES 7
Level 7

Re: API issue - Activities

Batch size of 300 means you get 300 results per page. You can use the nextpagetoken from the current response to make the next call without having to get a new paging token for each month.

Level 1

Re: API issue - Activities

Of course I did that in (3a), with the results exposed.

Level 10 - Community Moderator

Re: API issue - Activities

Why did you stop, *exactly*?

Level 10 - Community Moderator

Re: API issue - Activities

I don't understand what you're referring to as a "stop marker".

Level 1

Re: API issue - Activities

With "stop marker" I mean the last item returned by the API. I agree that "stop marker" is not appropriated..

I formatted them in Bold-uderlined in the results.

Level 3

Re: API issue - Activities

I'm not sure what's confusing here.

After means from the start date specified by your initial nextPageToken until now. There's no date range option for that endpoint.

Level 10 - Community Moderator

Re: API issue - Activities

Something tells me it's the ol' empty result set with more results confusion.