Get Activity Types via API returns a character wrapped in brackets for a Marketo Custom Object field named ID

Issue

Executing a GET API call to retrieve a list of available activity types in the target instance using the '/rest/v1/activities/types.json' endpoint, resolves with an unexpected attribute name for a field with the display name ID in the context of Marketo Custom Objects.

An example of that may be a Marketo Custom Object with the following name: '3 to be', as can be shown in the image below:
Marketo Custom Object Name

One of the '3 to be' Marketo custom object fields name is 'ID'. (highlighted in red).

When performing a GET API call using the '/rest/v1/activities/types.json' endpoint, you will be getting a list of available activity types in the target instance, along with associated metadata of each type, however for a Marketo custom object with an ID field name, you may see it returns back with a slightly different name, in this case, it would be returning the following output for my test Marketo Custom Object activity:
{
            "id": 100019,
            "name": "Add to 3 to be",
            "primaryAttribute": {
                "name": "3 to be ObjRef",
                "dataType": "integer"
            },
            "attributes": [
                {
                    "name": "3 To Be Person Id",
                    "dataType": "integer"
                },
                {
                    "name": "ID (3)",
                    "dataType": "string"
                },
                {
                    "name": "Linkfield4",
                    "dataType": "string"
                }
            ]
        }
    ],
Here's an image of what it may look like when making the call using POSTMAN:
postman get activities output

In fact, the character in the brackets next to the ID field represents the very first character of your Marketo Custom Object name. 




 

Environment

Customers who have Marketo Custom Objects where one of the custom object fields is named 'ID'.

Solution

If this is interrupting your business, you may want to select a different name for the ID field under your Marketo Custom Object. (ie. ID number, Transaction ID etc.)

Root Cause

This behavior is expected and is a result of the 'ID' field being a unique field in the context of Marketo custom objects world and while it may be possible to create a Marketo Custom Object field with the name 'ID', it may be better to give it a distinct name that will be better describing what kind of ID field it is. 
 

Labels (2)