function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
newguySFnewguySF 

send data to a REST API every time a new account is added to Salesforce

Hi folks,

Sorry for the total newbie question here regarding triggers, but here is my scenerio:

What are some of the options available to send data to a 3rd party REST API every time a new account is added to Salesforce?

I have been initially looking at code examples for triggers on account after insert. In addition to this, is there a way using the SFDC streaming API? Any ideas on What API usage is best practice + code examples would be much appreciated. 

Thanks in advance!

Satish_SFDCSatish_SFDC

You can create a workflow which automatically sends an Outbound message to the webservice, when an account is created.

 

For further information check this link: http://www.salesforce.com/docs/developer/cookbook/Content/workflow_om.htm

 

Hope this helps.

 

Regards,

Satish Kumar


Please mark my answer as a solution if it was helpful so it is available to others as a proper solution.
If you felt I went above and beyond, please give me Kudos by clicking on the star icon.

Satish_SFDCSatish_SFDC

Another link about the Workflow rules:

 

http://login.salesforce.com/help/doc/en/creating_workflow_rules.htm

 

Regards,

Satish Kumar

newguySFnewguySF

Thanks for the reply but, from my understanding, the Outbound Message  action is SOAP only on workflow rules. Is that correct? I'm looking to send the message to a REST API.

 

 

Thanks for the help.

Satish_SFDCSatish_SFDC

Well, in that case you would have to write an Apex class which calls a Webservice everytime a record is created.

 

You could also do some sort of Client Polling but that would periodically check for new records but that would be a strain on resources.

 

Regards,

Satish Kumar

newguySFnewguySF
Thanks for the info. Could you think of any simple workflow rule, chatter API, or streaming API hacks that might be worth looking out?

Thanks again for all the help!