SOLVED

Re: External Activities endpoint returns "success" and "skipped"

Go to solution
Anonymous
Not applicable

External Activities endpoint returns "success" and "skipped"

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.

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: External Activities endpoint returns "success" and "skipped"

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": []

  }

]

}

View solution in original post

6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: External Activities endpoint returns "success" and "skipped"

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.

Anonymous
Not applicable

Re: External Activities endpoint returns "success" and "skipped"

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()

SanfordWhiteman
Level 10 - Community Moderator

Re: External Activities endpoint returns "success" and "skipped"

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).

Anonymous
Not applicable

Re: External Activities endpoint returns "success" and "skipped"

Now sending ISO8601 with seconds only, response is the same however.

SanfordWhiteman
Level 10 - Community Moderator

Re: External Activities endpoint returns "success" and "skipped"

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": []

  }

]

}

Anonymous
Not applicable

Re: External Activities endpoint returns "success" and "skipped"

Thank you so much Sanford, that was the issue!