You need to sign in to do that
Don't have an account?
Ayush_Mangal
Webhook API Makes a HTTP POST request to your URL with POST parameters
The server (through Webhook API) makes a HTTP POST request to my URL ( I can only set the URL on server ) with POST parameters whenever an event occours on the server side. I want to insert a record on custom object, reading POST Parameters.
Can someone explain What I need to do..
-Do i need to make a Public Web Service in Salesforce
-Does Anyone have a better idea.
You can write an apex rest service (.e.g. see http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_rest_code_sample_basic.htm) then expose it for anonymous access by using sites. Alternatively you can write the web listener in java or ruby or similar and have it make API calls to salesforce, you could then deploy this on heroku.
Hi,
Did you get any solution.. I am facing the same issue..can you share some code snippet.
Help would be much appreciated ..
Hi miku1051
Yes, I got the solution.
You can create a Rest based WEB Service that can handel HTTP POST request inside your org and expose that to the Webhook API Http Post request with parameters along with the request.
You can check it youself using http://www.hurl.it/. This is a great site one can use to send POST/GET Request to check their web-services.
Thanks for your reply..
I will test on this site.
but can you please provide me some code snippet for the same....?
HI,
You can post your snippet here and brifly state what you are doing, which Webhook API are you using and all.
Hi Ayush
I am getting this response in web service-
As you can see in this code iam getting some parameters that are keyword in salesforce.
Can you please help me for sending parameters in below class
any help will be appreciated..
Please Try this:
@HttpPost
global static string myMethod(){
RestRequest req = RestContext.request;
Map<String,string> paramMap = req.params; System.debug('PRAM '+paramMap);
String a1 = paramMap.get('Event');
String a2 = paramMap.get('From');
String a3 = paramMap.get('To');
String a4 = paramMap.get('Date');
-
- // You can map different parametrs in different Variables.
-
// do something
}
If works, please mark this as solution.
When i am using the same i am not getting any value in the map....am i missing something...
Are you checking your web-service through http://www.hurl..it/. Can you send what is the reply you are getting when you send a Post request
this is my complete request and response
I have used this its working now...
thanks for help...
As you can see you are receving status code 200 in reply, that means your web-service is running fine and returning the responce correct. Their can be somthing wrong with content-type or in Code.
Link here if this helps anyone else out:
http://moometric.com/integrations/sf/salesforce-visual-workflow-plugin-post-json-callout-external-webservice/
Postman is how you can send get/post data from your computer to some endpoint for testing purposes.