API issue - Activities | Community
Skip to main content
Pascal_Antz
Level 2
January 21, 2020
Question

API issue - Activities

  • January 21, 2020
  • 5 replies
  • 4619 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

5 replies

Jay_Jiang
Level 10
January 21, 2020

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.

Pascal_Antz
Level 2
January 21, 2020

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

SanfordWhiteman
Level 10
January 22, 2020

Why did you stop, *exactly*?

SanfordWhiteman
Level 10
January 21, 2020

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

Pascal_Antz
Level 2
January 22, 2020

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.

Tony_Mayse
Level 2
January 22, 2020

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.

SanfordWhiteman
Level 10
January 22, 2020

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