You need to sign in to do that
Don't have an account?

how to send json data form salesforce to external system using restresourse with username and password authentication
How to send json data form salesforce to external system using restresourse with username and password authentication ..?
Then use salesforce apex/outbond message to call the external authentication
To call the external system you may need to write the web service call out. Check this article about the callouts https://developer.salesforce.com/page/Apex_Web_Services_and_Callouts
use HttpRequest class to create a request
Please make sure to mark this as the best answer if this help you, as it could help more people in the community in future.
Ruwantha Lankathilaka,
Thanks for your quick response. The above method is ok. but I would like to do using @Restresouse and @HttpPost Annotations. How can we do in this way.
Thanks in Advance!
Regards,
Riaz.
By your reply I assume you want to expose your class as a web service ? if so follow the instruction given bellow
first create a connected app and enable OAuth
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_web_server_oauth_flow.htm
then create a webservice class
https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST
first try a simple example as bellow
This should be able to access via following URL
https://na8.salesforce.com/services/apexrest/MyWebService
To make this work I recomend you to try with postman
https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en
Please make sure to mark this as the best answer if this help you, as it could help more people in the community in future.