SOLVED

Re: "success" flag in the REST endpoint response

Go to solution
Anonymous
Not applicable

"success" flag in the REST endpoint response

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

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: "success" flag in the REST endpoint response

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Re: "success" flag in the REST endpoint response

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