Problem adding a field value to custom activity | Community
Skip to main content
May 22, 2018
Solved

Problem adding a field value to custom activity

  • May 22, 2018
  • 1 reply
  • 2856 views

Hello,

I am confronting with a problem when trying to add a field value to a custom activity using REST API. I've created the field, I've saved the custom activity. When I try to add the activity without that field, it all works well (i.e. the custom activity is saved in marketo, and can be seen there). But if I try to add the field "productTest", the returned message is: "'Invalid attribute 'productTest''".

This is the payload (hope I'm using the right term):

{

     "input": [

          {

               "leadId": 32763,

               "activityTypeId": 100001,

               "primaryAttributeValue": "description of what is going on",

               "activityDate": "2018-05-22T08:37:36+00:00",

               "attributes": [

                    {

                         "name": "productTest",

                         "value": "test a new field"
                    }

               ]

          }

     ]

}

This is how the fields look like inside the marketo admin:

And this is how the custom activity looks like:

What am I doing wrong?

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

Please show the JSON response to a Describe Custom Activity request. And use the Advanced Editor's syntax highlighter when posting code.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 22, 2018

Please show the JSON response to a Describe Custom Activity request. And use the Advanced Editor's syntax highlighter when posting code.

May 23, 2018

Thank you very much. Looking at the Describe custom activity illuminated me. I was wrongly using the "apiName" as "name" (although, to be honest, is more intuitive to use the apiName in the api).

[49] => stdClass Object

     (

          [id] => 100001

          [name] => Testing Marketo

          [apiName] => testingMarketo_c

          [description] => This is a custom activities test

          [primaryAttribute] => stdClass Object

               (

                    [name] => The test

                    [apiName] => theTest

                    [dataType] => string

               )

          [attributes] => Array

               (

                    [0] => stdClass Object

                         (

                              [name] => Product Test

                              [apiName] => productTest

                              [dataType] => string

                         )

                    [1] => stdClass Object

                         (

                              [name] => Profile-Deleted-468

                              [apiName] => profile-Deleted-468

                              [dataType] => string

                         )

               )

     )

SanfordWhiteman
New Participant
May 23, 2018

Agreed, that's strange nomenclature.