Custom Activity API Script Configuration

Jeremy_Foote_-_
Level 2

Custom Activity API Script Configuration

We're attempting to track whenever a lead logs into our SaaS product.

We thought we had the configuration accurate, but keep receiving "skipped" as a response.

The Custom Activity has been approved.

Is the Scripting below accurate? The primaryAttributeValue throws us for a loop.

 

Custom Activity Values:

100009

Logged Into CMP

loggedIntoCMP_c

 

  Approved

 

 

Logged Into CMP

Logs Into CMP


Field Settings:
Name: CMP Logged In

API Name: cMPLoggedIn

Data Type: String

 

Script:

{
"input":[
{    
"leadId":509,
"activityDate":"2017-01-24T12:30:00-08:00",
"activityTypeId":100009,
"primaryAttributeValue":"loggedIntoCMP_c",
"attributes":[
{
"name": "cMPLoggedIn",
"value": "True"
}
]
}

 

Thanks,

JFoote

10 REPLIES 10
SanfordWhiteman
Level 10 - Community Moderator

Re: Custom Activity API Script Configuration

What's the error message accompanying the skipped status?

The primaryAttributeValue shouldn't be the API name of the CA (or rather, there's no need for it to be).

Also, are you paying attention to daily API rate limits with your approach?

Jeremy_Foote_-_
Level 2

Re: Custom Activity API Script Configuration

We're not getting an error message back.

So the primaryAttributeValue doesn't have to correlate to any of the activity fields. It can be a custom value

{

"input":[

{   

"leadId":509,

"activityDate":"2017-01-24T12:30:00-08:00",

"activityTypeId":100009,

"primaryAttributeValue":"Logged into CMP",

"attributes":[

{

"name": "cMPLoggedIn",

"value": "True"

}

]

},

Yes, we're paying attention to the API Rates, we don't have a huge audience for this application.

Anonymous
Not applicable

Re: Custom Activity API Script Configuration

Is Lead ID 509 exist?

I tried "skipped" case.

When the lead is non-existent, "skipped" was returned

Anonymous
Not applicable

Re: Custom Activity API Script Configuration

The other case

If the custom activity 100009 isn't approved or is wrong id, "skipped" is returned.

Jeremy_Foote_-_
Level 2

Re: Custom Activity API Script Configuration

Verified the following.

The Lead exists with the correct Lead ID.

The Custom Activity is approved and the ID is accurate.

Any other ideas?

JF

Anonymous
Not applicable

Re: Custom Activity API Script Configuration

Did you ever find the solution? Running into a similar issue.

SanfordWhiteman
Level 10 - Community Moderator

Re: Custom Activity API Script Configuration

Please provide

  1. The JSON payload sent to the /external.json endpoint
  2. The Custom Activity description from the Describe Activities endpoint
Rob_Alfieri
Level 2

Re: Custom Activity API Script Configuration

Special note in case folks don't realize it. When adding your attribute fields, if you use "name", you must use the Display Name for the attribute. If you want to use the API name, use "apiName". Drove me crazy.  Example below.

{

"input": [

{

  "leadId": 2000950,

  "activityDate": "2018-04-01T23:18:34Z",

  "activityTypeId": 100008,

  "primaryAttributeValue": "PEPTIDE XB-C18",

  "attributes": [

  {

  "apiName": "productBrand",

  "value": "Aeris"

  },

      {

      "apiName": "orderNumber",

      "value": "APR012018"

      },

  {

  "apiName": "productSKU",

  "value": "PEPXBC18"

  },

  {

  "apiName": "orderDate",

  "value": "2018-04-01"

  },

  {

  "apiName": "orderQuantity",

  "value": 1

  },

  {

  "apiName": "productPromo",

  "value": "None"

  }

  ]

}

]

}

Rob Alfieri | Principal Solutions Architect | Adobe | Marketo Engage
mk_sap
Level 1

Re: Custom Activity API Script Configuration

Hi Rob, What if we want to push custom activity and we have email ids of leads to push into the Marketo but not lead id? How to achieve this scenario using email ids only. Thanks