Next up, the REST API, which is, relatively speaking, a new thing. The custom object parts of the REST API are documented on the developer blog on their own separate page, and in my opinion it makes sense to monitor that page for changes so you know when the API has new features added.
For the purposes of this, I'll be referencing the Automobile object that I created in part 1 of this series, and I'll be using Postman to make my REST calls. (note you can read about use of the SOAP api in Part III of the series) Here's what it looks like:
Request
jSON Payload
{
"action": "createOrUpdate",
"dedupeBy": "dedupeFields",
"input": [
{
"bodystyle": "Coupe",
"color": "Silver",
"make": "Hyundai",
"model": "Sonata Hybrid",
"year": "2015",
"vinnumber": "KMHEC4A4XFA129411",
"emailaddress": "jmattos@marketo.com"
}
]
}
Response
{
"requestId": "8ca7#14e6ad1cc70",
"result": [
{
"seq": 0,
"status": "created",
"marketoGUID": "98f652e8-e8f0-47b1-a1f7-18dc005007c3"
}
],
"success": true
}
Request
jSON Payload
{
"deleteBy":"dedupeFields",
"input":[
{
"emailaddress":"jmattos@marketo.com",
"vinnumber":"KMHEC4A4XFA129411"
}
]
}
Response
{
"requestId": "ed07#14e6b34c01e",
"result": [
{
"seq": 0,
"status": "deleted",
"marketoGUID": "6c485902-3663-4b0b-adfd-e183e33cb285"
}
],
"success": true
}
So there you have it. a Sample REST call to Create a custom object, and one to Delete a custom object. The other calls are really quite similar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.