While creating webhook from salesforce apex callout or from postman. I am getting same error everytime.
{
"eventFilters": [
"/restapi/v1.0/account/~/extension/~/message-store?type=SMS&direction=Inbound"
],
"deliveryMode": {
"transportType": "WebHook",
"address": "https://aabidlwc-developer-edition.ap16.force.com/services/apexrest/ringcentralwebhook"
}
}
Please help me, I'm trouble with this.
Where and how do you handle the validationToken?
Please read this dev guide to learn more how to useRingCentral WebHooks notification.
I' sending the following parameter in header & body, If I'm wrong please correct me: -
In header
Accept : application/json
Authorization : Bearer MyAccessToken
Content-Type : application/json
In Body
Json Data =>
{
"eventFilters": [
"/restapi/v1.0/account/~/extension/~/message-store?type=SMS&direction=Inbound"
],
"deliveryMode": {
"transportType": "WebHook",
"address": "https://aabidlwc-developer-edition.ap16.force.com/services/apexrest/test/v1"
}
}
but it give me 500 error, if I miss something or doing any mistake please correct me.
Thank you
That is the code you subscribe for webhooks notification. You still have to implement your code to handle the notifications where you must handle (return) the validation token. Read the dev guide carefully.
can we please specify the mistake in returning validation token in apex.
I'm new in this platform that's why I'm facing lots of problem.
to handle Webhook I'm creating rest resources but not able to found correct way.
@RestResource(urlMapping='/test/v1/*')
global class ringcentralWebhook
{
@HttpPost
global static String doPost()
{
RestRequest req = RestContext.request;
RestResponse res = RestContext.response;
String JsonBody = req.requestBody.toString();
Map<String, Object> body = (Map<String, Object>)Json.deserializeUntyped(JsonBody);
String s = String.valueOf(body);
contact c = new contact(lastName = 'test ringcentral', description=s);
insert c;
String VToken = req.params.get('validation-token');
return VToken;
}
}
Thank you. @Phong Vu
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder