You need to sign in to do that
Don't have an account?
ran67
Webhook Integrations salesforce
Hi,
I have activate my site url in the campagain mointor and now am able to run my class and page when a record is edit in the webhook . as per document they told when the url is executed the json data will added . bt when am making the http request Post to the site url am getting the error has 401 of the error has unauthorized error.
Can you please how to call the post Request in the salesforce and read the json data .
create a rest resource class and add this class to site and give this public class url to webhook.webhook will post data to this class.You can access the data as shown below.using json parser methods you can parse json data.
@RestResource(urlMapping='/webhookRespose/*')
global class FirstAdvantageRestController {
public static string restResponse='';
@HttpPost
global static string FAResponse()
{
RestRequest req = RestContext.request;
String ipAddress = req.remoteAddress;
Blob body = req.requestBody;
system.debug('...................'+req);
String bodyString = body.toString();
system.debug('...................'+bodyString );
}
}
let me know if it helped