External Activities endpoint returns "success" and "skipped" | Community
Skip to main content
December 5, 2017
Solved

External Activities endpoint returns "success" and "skipped"

  • December 5, 2017
  • 1 reply
  • 2902 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

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

  }

]

}

1 reply

SanfordWhiteman
Level 10
December 5, 2017

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.

December 5, 2017

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
December 6, 2017

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