SOLVED

Re: Having trouble with Batch Export Activity IDs

Go to solution
FirstEnt_Develo
Level 2

Having trouble with Batch Export Activity IDs

Hi everyone,

I am trying to set up a daily process to retrieve all of our unsubscribes from the activity batch export. However, when I specify the activity ids that I want, the batch is ignoring them and returning the full data set. Not sure what is going on here, TIA.

Here is my json that I am sending as part of my request. I know that 9 is the unsubscribe id, I just have 5 in there as a test

"{

      "format": "CSV",

      "filter":{"createdAt":{"startAt":"2019-12-27T00:00:00Z","endAt":"2019-12-28T00:00:00Z"} },

      "activityTypeIds": [5,9]

}"

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Having trouble with Batch Export Activity IDs

{
"format" : "CSV",
"filter" : {
"createdAt" : {
"startAt" : "2019-12-27T00:00:00Z",
"endAt" : "2019-12-28T00:00:00Z"
}
},
"activityTypeIds" : [ 5, 9 ]
}

That doesn't conform to the JSON schema.

It should be:

{
"format" : "CSV",
"filter" : {
"createdAt" : {
"startAt" : "2019-12-27T00:00:00Z",
"endAt" : "2019-12-28T00:00:00Z"
},
"activityTypeIds" : [ 5, 9 ]
}
}

View solution in original post

8 REPLIES 8
Mark_Price
Level 7

Re: Having trouble with Batch Export Activity IDs

What happens if you remove the 'Z' on the end of the date/times? 

FirstEnt_Develo
Level 2

Re: Having trouble with Batch Export Activity IDs

Hi Mark,

just left the date, still the same problem

Mark_Price
Level 7

Re: Having trouble with Batch Export Activity IDs

hmm..  did you check what the activityTypeIds are ? 

This will retrieve a list:  

https://developers.marketo.com/rest-api/lead-database/activities/#describe  

In my instance values 4 and 5 aren't listed.   Not sure if that's true for all, but worth checking 

FirstEnt_Develo
Level 2

Re: Having trouble with Batch Export Activity IDs

That's probably a bit irrelevant, I had it with 3 instead of 5 and I was still getting activity type 1

Harish_Gupta6
Level 8

Re: Having trouble with Batch Export Activity IDs

Didn't see Activity type 5 in my instance but Activity 9 is for Unsubscribe and below are the step which we are using:

1) Get the Access Token

2) Get the nextPageToken Eg

URL:/rest/v1/activities/pagingtoken.json
Pass DateTime: 2019-01-01T00:00:00-08:00 in the query parameter
3) Fetch the activities and add nextPageToken  and Activitytypeids in the query parameter in the request
Harish Gupta
FirstEnt_Develo
Level 2

Re: Having trouble with Batch Export Activity IDs

hm... I'll try this, but I'd like to do it with the batch option, if possible. If this works, though, I guess we will switch over.

The 5 type was just a placeholder for my testing

SanfordWhiteman
Level 10 - Community Moderator

Re: Having trouble with Batch Export Activity IDs

{
"format" : "CSV",
"filter" : {
"createdAt" : {
"startAt" : "2019-12-27T00:00:00Z",
"endAt" : "2019-12-28T00:00:00Z"
}
},
"activityTypeIds" : [ 5, 9 ]
}

That doesn't conform to the JSON schema.

It should be:

{
"format" : "CSV",
"filter" : {
"createdAt" : {
"startAt" : "2019-12-27T00:00:00Z",
"endAt" : "2019-12-28T00:00:00Z"
},
"activityTypeIds" : [ 5, 9 ]
}
}
FirstEnt_Develo
Level 2

Re: Having trouble with Batch Export Activity IDs

Thank you Sanford,

I had copied the json from another process and didn't realize it sits inside the filter. Now I'm getting a 500 error when trying to download the file, but I'm sure it's unrelated.

EDIT: I was running the batch for a day that had no unsubscribes, which resulted in the 500 error.