on ‎2021 Oct 13 12:05 PM
Dear Team,
I need to post method call response in json format i have tried below format like get call but it's not supporting for post method call for any c4c odata api like Contactcollection. Could you please guide me how to get it. By defalut it's giving XML response successful but in same way we need in json format.
https://myXXXXXX.crm.ondemand.com/sap/c4c/odata/v1/c4codataapi/ContactCollection?$format=json
Thanks and Regards,
MD.
Request clarification before answering.
Thanks it's working fine now. I have added Accept manually then it's working fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
For post-call, pls pass a header parameter "Content-Type" as "application/json"(https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) and then the system will accept JSON input payload. Similarly, if you also want to get response back in JSON then also pass another header "Accept" as "application/json" (https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation/List_of_default_Accept_values).
BR
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Saurabh,
I have passed content type - application/json but still on postman tool response in xml only and if try to change manually into json still it's in xml only on postman tool. Please find attached screen shot of it.
For get call i am getting after adding $format=json but this syntax in post method url is not working. COuld you please guide me again can we get in json for post method call.
Thanks and Regards,
MD.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.