Re: Custom Activity REST API Response Error

Anonymous
Not applicable

Custom Activity REST API Response Error

Hi everyone,

I am trying to create a custom activity in marketo for leads with Marketo REST API. I'm following all the given steps in the documentation: http://developers.marketo.com/rest-api/lead-database/activities/#add_custom_activities and getting undesirable response. I am trying to create the activities for leads which exist in marketo database, but  when I post my request data to the create activities endpoint, every time I am getting the result of "status: skipped". I checked the meaning of this response that it shows when the api cannot find any lead in marketo, although I am passing a known lead's id in the request body's paramenter: "leadId".

When I am trying to get the activity details for the same lead(s), I am getting the accurate response. I am trying to understand if I am missing any step and I thoroughly done my RnD on it. Still cannot figure out why such a response is showing. If anyone out there have a slight clue about this same issue please share your insights with me. Would be a great deal of help if you guys could help me sort this out. This is the response that I am getting on every POST hit:

Response Status:{

  "requestId": "xxxxxxxxxx",

  "result": [

    {

      "status": "skipped"

    }

  ],

  "success": true

}

Thanks,
Sid

4 REPLIES 4
Anonymous
Not applicable

Re: Custom Activity REST API Response Error

Now that I am getting a success result with the a simple hit like this one:

{

  "input": [

    {

      "activityDate": "string",

      "activityTypeId": 0,

      "apiName": "string"
}
]
}

But I am getting the "Skipped" status response when I include the array list of secondary attributes:

{

  "input": [

    {

      "activityDate": "string",

      "activityTypeId": 0,

      "apiName": "string",

"attributes": [

        {

          "apiName": "string",

          "name": "string",

          "value": {}

        }

      ]

}
]
}

The status "skipped" only occurs when the POST request is not able to find that particular lead in marketo against whom the custom activity is being written. But the lead does exist in marketo and I'm running these against various leads that do exist in marketo.

Sanford Whiteman​ do you have any clue about this. I know the same issue is visible in these posts as well: Custom Activity API Script Configuration and Can't add custom activity Do share you insights on this. Would be an enormous help.

Regards,

Sid

SanfordWhiteman
Level 10 - Community Moderator

Re: Custom Activity REST API Response Error

Please look more closely at my example payload at Can't add custom activity

You seem to be mixing together generic model values with your site-specific values.

Things like "activityTypeId":0 and "value":{} are a tipoff that you're not sending real-world activity data. It can still be test data, yes, but it has to be realistic data that fits the model. An empty Object doesn't make sense to pass as a value.

Anonymous
Not applicable

Re: Custom Activity REST API Response Error

Sanford Whiteman​ Thanks a bunch!!!. I'm getting the right result now. Just learnt that in the "attributes" array object, I need to pass the original/relevant names or the api names of the secondary fields created in the custom activites. Before I had been using names such as "test", which actually needed to be the names/api names of those secondary fields although their values could be test or arbitrary depending on the field type.

Regards,
Sid

SanfordWhiteman
Level 10 - Community Moderator

Re: Custom Activity REST API Response Error

Great, glad it's working.