I have some code that was working at one time, but currently does not.
I first use the describe endpoint to get the fields for a custom object:
Then I invoke Get Custom Objects using those fields:
This previously worked, but now it's returning an error of:
This is also confusing due to the fact that code 609 is documented in http://developers.marketo.com/documentation/rest/error-codes/ as "Invalid JSON", yet the JSON parses fine. Any help would be greatly appreciated.
Hi Atul
According to http://developers.marketo.com/documentation/custom-api/get-custom-objects/
I think you don't need "_method=GET" parameter in GET method.
Atul,
I assume that you are using HTTP POST method.
The problem here is "fields" attribute in the JSON in the request body. It should be an array of strings.
Instead of this:
{
"fields": "createdAt,marketoGUID,updatedAt,,…”,
"filterType": "marketoGUID",
"filterValues": "01e13ebd-39e9-46da-8978-bd6de880df4c"
}
Use this:
{
"fields": ["createdAt”,”marketoGUID”,”updatedAt”,…],
"filterType": "marketoGUID",
"filterValues": "01e13ebd-39e9-46da-8978-bd6de880df4c"
}
-Dave
Yeah
Docs explains "fields" is comma separated.
fields
Optional
Comma separated list of field names.
If not specified, then response contains the following fields:
- marketoGuid
- dedupeFields
- updatedAt
- createdAt
But if you are using POST, you need to change to JSON array format as same as Dave said.
/rest/v1/customobjects/Car.json?_method=GET
{
"filterType":"dedupeFields",
"fields":[
"marketoGuid",
"Bedrooms",
"yearBuilt"
],
"input":[
{
"mlsNum":"1962352",
"houseOwnerId":"42645756"
},
{
"mlsNum":"2962352",
"houseOwnerId":"52645756"
},
{
"mlsNum":"3962352",
"houseOwnerId":"62645756"
}
]
}