External Activities endpoint returns "success" and "skipped" | Community
Skip to main content
Dec 5, 2017 11:28 PM UTC
Solved

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 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.
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Dec 6, 2017 2:04 AM UTC

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

  }

]

}

6 replies

SanfordWhiteman
Level 10
Dec 5, 2017 11:47 PM UTC

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.

Translate
Dec 5, 2017 11:52 PM UTC

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

Translate
SanfordWhiteman
Level 10
Dec 6, 2017 12:03 AM UTC

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

Translate