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]
}"
Solved! Go to Solution.
{
"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 ]
}
}
What happens if you remove the 'Z' on the end of the date/times?
Hi Mark,
just left the date, still the same problem
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
That's probably a bit irrelevant, I had it with 3 instead of 5 and I was still getting activity type 1
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
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
{
"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 ]
}
}
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.