0

I'm trying to build a webservice that will expose the ability to input data from an external system into salesforce.

I've found multiple resources on making a webservice.

I can't however find how to structure the actual http POST to Salesforce from another system.

1

Depends on a few things...what platform is the source system using? Are you authenticating? If so, what method?

EDIT You can post to SF anonymously by exposing an APEX class on the profile of the public site user that gets created for each site. As such, you don't need an additional licence to capture the request, BUT that is now a publicly accessible endpoint, so anyone can post there and potentially mess with your data unless you add some form of security check. Also, a public site user has certain restrictions e.g. can't update standard objects, can't write to chatter etc.

If you use some form of authentication e.g. oauth, it will require you to set up the authentication flow, and require you to have a user that flow can login as. But that approach is more secure, and that user can then have as much access as the permissions allow.

For a simple example of how to post to a APEX rest service using CURL, you can look here:

curl -H "Authorization: Bearer sessionId" -H "Content-Type: application/json" -d @account.txt "https://instance.salesforce.com/services/apexrest/Account/"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.