Hi there,
I'm attempting to associate a lead with a custom activity, but unfortunately having some trouble.
With a request like the following:
POST https://xx-EOV-xx.mktorest.com/rest/v1/activities/external.json
{"input": [
{"status": "created",
"leadId": 28782906,
"primaryAttributeValue": "Name Registered",
"activityDate": "2017-12-05T23:18:34.932545",
"attributes": [{"name": "myApiName", "value": "foo"}],
"activityTypeId": 100003}]}'
I get the following response:
{'requestId': 'xxx', 'success': True, 'result': [{'status': 'skipped'}]}
Looking at the activity log for the lead, it does indeed appear that storing the event has been skipped.
Would be very grateful if someone could point me in the right direction, thank you.
Solved! Go to Solution.
You only have a primary attribute here:
{
"apiName": "registerName_c",
"description": "Name registered.",
"id": 100003,
"name": "Register Name",
"primaryAttribute": {
"apiName": "name",
"dataType": "string",
"name": "Name"
}
}
so your request payload should look like:
{
"input": [
{
"activityTypeId": 100003,
"activityDate": "2017-12-05T23:18:34Z",
"leadId": 28782906,
"primaryAttributeValue": "Name Registered",
"attributes": []
}
]
}
Please provide the Describe response JSON for this Activity Type (and use the JS syntax highlighter).
Also, that microsecond time will surely not be used. Try ISO seconds only.
Hey Sanford,
Thanks for the reponse. The types.json endpoint returns:
{
"apiName": "registerName_c",
"description": "Name registered.",
"id": 100003,
"name": "Register Name",
"primaryAttribute": {
"apiName": "name",
"dataType": "string",
"name": "Name"
}
}
I can certainly tweak the date, that's just the default provided by python's:
datetime.utcnow().isoformat()
Assume date-like strings in JSON should be in ISO8601 web profile without fractional seconds. And even though you're passing strings, unless specified otherwise the underlying datetime implementation should be expected to have millisecond granularity only (for example, nanosecond and microsecond dates in JS require a custom datatype, not Date).
Now sending ISO8601 with seconds only, response is the same however.
You only have a primary attribute here:
{
"apiName": "registerName_c",
"description": "Name registered.",
"id": 100003,
"name": "Register Name",
"primaryAttribute": {
"apiName": "name",
"dataType": "string",
"name": "Name"
}
}
so your request payload should look like:
{
"input": [
{
"activityTypeId": 100003,
"activityDate": "2017-12-05T23:18:34Z",
"leadId": 28782906,
"primaryAttributeValue": "Name Registered",
"attributes": []
}
]
}
Thank you so much Sanford, that was the issue!