You need to sign in to do that
Don't have an account?
shakila G
IF records getting created inSalesforce how to send data as JSON Response to Third party application from salesforce?
Hello All,
If the custom object record getting created in salesforce i want to send that data to third party application as JSON Response.
If any having sample code please share to review the steps
Thanks,
Shakila
Following code is for sending a request to 3rd Party app "Twilio"
Further as per your requirement you can send JSON data in setbody. You just need to serialize it to JSON, use JSON.serialize(data) for this.
For more info on sending data refer:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_restful_http_httprequest.htm
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
Greetings to you!
You can use the serialize method of JSON class to convert the data into a JSON format. Use this code logic in your Insert Update Trigger:
So, you can collect all the newly created accounts into a list and then make a single call to the API.
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas