SOLVED

Bulk API-Activities: Not filtering ActivityTypeids

Go to solution
kajal_das
Level 1

Bulk API-Activities: Not filtering ActivityTypeids

all,

 

I am trying to pull the activities data using bulk api, as a parameter I am supplying few activityTypeIds and expecting API should bring only those id's but what I am seeing it's bringing everything!   not sure what  I am doing wrong.   here the api request.   does anyone faced this issue?    how to solve this.  note : i do not want to use normal api call, must use bulk api.

headers = {'Authorization': 'Bearer ' + token}
params = {
"activityTypeId": [1,2,3,6,7,8,9,10,11,12],
"format": "CSV",
"filter": {
"createdAt": {
"startAt": startAt, # "2022-10-02T23:59:59-00:00",
"endAt": endAt # "2022-10-03T23:59:59-00:00"
}
}
}
resp = requests.post(host + '/bulk/v1/activities/export/create.json', headers=headers, json=params)

  

2 ACCEPTED SOLUTIONS

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Bulk API-Activities: Not filtering ActivityTypeids

Well, it’s only spelled one way: activityTypeIds. and it goes inside the "filter" property, not outside, as shown in the docs.

 

In general you shouldn’t supply code in any particular language, what matters is the JSON payload.

View solution in original post

kajal_das
Level 1

Re: Bulk API-Activities: Not filtering ActivityTypeids

thank you. after i move the parameter under "filter" , it worked.   thank you for responding so quickly,

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Bulk API-Activities: Not filtering ActivityTypeids

as a parameter I am supplying few activityTypeIds

I would argue that you’re supplying a few activityTypeId. And that’s the problem. 🙂

kajal_das
Level 1

Re: Bulk API-Activities: Not filtering ActivityTypeids

i did passed with activityTypeIds also.  

SanfordWhiteman
Level 10 - Community Moderator

Re: Bulk API-Activities: Not filtering ActivityTypeids

Well, it’s only spelled one way: activityTypeIds. and it goes inside the "filter" property, not outside, as shown in the docs.

 

In general you shouldn’t supply code in any particular language, what matters is the JSON payload.

kajal_das
Level 1

Re: Bulk API-Activities: Not filtering ActivityTypeids

thank you. after i move the parameter under "filter" , it worked.   thank you for responding so quickly,