Not getting 201 response...getting 200 response

Hello @dchiesa1,

I am integrating two Salesforce instances using apigee edge, As a part of that i have created an API for target instance and tested by using postman. It is working fine with 201 response code with created record id.

But when i am testing the same via salesforce(source), i am getting 200 response and record is not getting created in target. What should i do now? I need record gets created..

0 1 234
1 REPLY 1

Hi Srinivas, 

OK when using postman, you see a 201 response and the record gets created. When you test .... via ...? "salesforce (source)" ?  you're seeing a 200 response, and not a 201.   I understand that you'd like to see a 201. 

What is "salesforce(source)"?  Is that a tool? I am not aware.

Is there Apigee involved at any point in this system?  Is Apigee connecting to salesforce via ServiceCallout?  Are you saying that the ServiceCallout is returning a 200?   Or are you observing that the API proxy that contains the ServiceCallout is returning 200 ?

Are you invoking TWO ServiceCallout policies, one to connect to each Salesforce instance?   if so, Which call is returning the 200?  

It's possible that a ServiceCallout that connects to a remote system can receive a 201, and then the API Proxy in which the ServiceCallout runs returns a 200 to the client.  If you need the ID of the created record, you will need to extend the API Proxy to use ExtractVariables to extract information from the ServiceCallout response. 

But I'm just guessing here, because I don't know how you have your systems set up, and I don't know which thing is returning a 200, and how you're invoking it.