"success" flag in the REST endpoint response | Community
Skip to main content
July 13, 2015
Solved

"success" flag in the REST endpoint response

  • July 13, 2015
  • 1 reply
  • 1815 views

Hi,

I am trying to call REST end (create/update lead), I am getting the following response:

{  "requestId": "f618#14e76a888a9", "result": [{"status": "skipped","reasons": [{"code": "1003","message": "Value for requried field 'id' not specified"}]}],"success": true}

While the error message is proper and justified, my problem is with the "success" value. Why is it set to "true" when my operation failed? Shouldn't it be false?

I am using this flag to raise exception in my code. In above case, it failed. Either the method should succeed or throw exception.

Thanks,

Rohit

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

Hi Vishnu

Your situation is your REST API protocol is correct, but lead data is not correct.

After api endpoint received the request, marketo run internal functions for each leads.

eg. new lead, change data value etc.

Finally marketo sends the result of functions.

Example 1 Response

  1. { 
  2.    "requestId":"e42b#14272d07d78",
  3.    "success":true,    <============ API status
  4.    "result":[ 
  5.       { 
  6.          "id":50,
  7.          "status":"created"  <========= Each status
  8.       },
  9.       { 
  10.          "id":51,
  11.          "status":"created"  <========= Each status
  12.       },
  13.       { 
  14.          "id":52,
  15.          "status":"created"  <========= Each status
  16.       }
  17.    ]
  18. }

If you are ok, show me your request sample.

Takehiro

1 reply

Accepted solution
July 18, 2015

Hi Vishnu

Your situation is your REST API protocol is correct, but lead data is not correct.

After api endpoint received the request, marketo run internal functions for each leads.

eg. new lead, change data value etc.

Finally marketo sends the result of functions.

Example 1 Response

  1. { 
  2.    "requestId":"e42b#14272d07d78",
  3.    "success":true,    <============ API status
  4.    "result":[ 
  5.       { 
  6.          "id":50,
  7.          "status":"created"  <========= Each status
  8.       },
  9.       { 
  10.          "id":51,
  11.          "status":"created"  <========= Each status
  12.       },
  13.       { 
  14.          "id":52,
  15.          "status":"created"  <========= Each status
  16.       }
  17.    ]
  18. }

If you are ok, show me your request sample.

Takehiro