Skip to main content
Solved

Webhook empty

  • October 21, 2024
  • 2 replies
  • 27 views

Forum|alt.badge.img

Issue details:

  • We have successfully set up the webhook endpoint in Salesforce, and during the validation phase, we received a valid Validation-Token.
  • On one occasion, we were able to successfully retrieve the request body, which included the expected event data. Below is a sample log from that successful attempt:

/*****************************************

12:47:02.1 (14197701)|VARIABLE_SCOPE_BEGIN|[10]|validationToken|String|false|false 12:47:02.1 (14204992)|VARIABLE_ASSIGNMENT|[10]|validationToken|null 12:47:02.1 (14208322)|STATEMENT_EXECUTE|[11] 12:47:02.1 (14209696)|STATEMENT_EXECUTE|[17] 12:47:02.1 (14244104)|HEAP_ALLOCATE|[17]|Bytes:863 12:47:02.1 (14248825)|VARIABLE_SCOPE_BEGIN|[17]|requestBody|String|false|false 12:47:02.1 (14254993)|VARIABLE_ASSIGNMENT|[17]|requestBody|"{\"uuid\":\"80248989911 (843 more) ..." 12:47:02.1 (14257582)|STATEMENT_EXECUTE|[18] 12:47:02.1 (14259132)|HEAP_ALLOCATE|[18]|Bytes:17 12:47:02.1 (14261990)|HEAP_ALLOCATE|[18]|Bytes:880 12:47:02.1 (14274894)|USER_DEBUG|[18]|DEBUG|WebHook Payload: {"uuid":"8024898991117000433","event":"/restapi/v1.0/account/613200067/extension/1483579067/telephony/sessions","timestamp":"2024-10-15T12:47:02.386Z","subscriptionId":"b60447d3-d0bc-4680-b234-31c1ab0a5670","ownerId":"1483579067","body":{"sequence":3,"sessionId":"224647578066","telephonySessionId":"s-a3016a11e18b6z1929037b274z68bc050000","serverId":"10.48.22.161.TAM","eventTime":"2024-10-15T12:47:02.342Z","parties":[{"accountId":"613200067","extensionId":"1483579067","id":"p-a3016a11e18b6z1929037b274z68bc050000-2","direction":"Inbound","to":{"phoneNumber":"363","name":"Piriya Sivalingam","extensionId":"1483579067"},"from":{"phoneNumber":"364","name":"Somashekar Bangalore","extensionId":"1521725067","deviceId":"800506572066"},"status":{"code":"Setup","rcc":false},"park":{},"missedCall":false,"standAlone":false,"muted":false}],"origin":{"type":"Call"}}}

*****************************/

 

  • However, since that successful attempt, every time we trigger real-time events (making a call), the webhook request body is always empty, while the Validation-Token is present in the headers.

/*******************************************

09:36:00.1 (12397579)|VARIABLE_ASSIGNMENT|[10]|validationToken|"827889c7-f82b-40ef-9 (16 more) ..."
09:36:00.1 (12401186)|STATEMENT_EXECUTE|[11]
09:36:00.1 (12402099)|STATEMENT_EXECUTE|[12]
09:36:00.1 (12403634)|HEAP_ALLOCATE|[12]|Bytes:27
09:36:00.1 (12406889)|HEAP_ALLOCATE|[12]|Bytes:63
09:36:00.1 (12421581)|USER_DEBUG|[12]|DEBUG|Validation-Token Received: 827889c7-f82b-40ef-986f-5fe569fb85ac
09:36:00.1 (12425793)|STATEMENT_EXECUTE|[13]
09:36:00.1 (12451169)|STATEMENT_EXECUTE|[14]
09:36:00.1 (12465024)|METHOD_ENTRY|[14]||System.RestResponse.addHeader(String, String)
09:36:00.1 (12539640)|METHOD_EXIT|[14]||System.RestResponse.addHeader(String, String)
09:36:00.1 (12544025)|STATEMENT_EXECUTE|[15]
09:36:00.1 (12610999)|HEAP_ALLOCATE|[15]|Bytes:4
09:36:00.1 (12645027)|STATEMENT_EXECUTE|[17]
09:36:00.1 (12674189)|VARIABLE_SCOPE_BEGIN|[17]|requestBody|String|false|false
09:36:00.1 (12681805)|VARIABLE_ASSIGNMENT|[17]|requestBody|""
**********************************/

As a result we are encountering the following error in our Salesforce logs:

/******************************************

System.JSONException: no content to map to Object due to end of input

**************************/

 

Steps taken: 

  1. We have confirmed that the validation token is processed correctly.
  2. We have updated our code to handle the validation token separately, ensuring the correct token is sent back to pass the validation phase.
  3. We have added checks to verify whether the request body is present before attempting to deserialize it, but the body remains empty even when the real-time events are triggered.

Could you please help us investigate why the webhook payload is empty when real-time events are triggered? Is there anything specific on RingCentral side that needs to be configured to ensure the full event data is sent in the webhook request?

 

Any guidance or insights are greatly appreciated as this is critical to our integration.

Best answer by PhongVu

If you see the validation-token header and its value in a webhook post request, it means that somehow in your code, the subscription API is called again. Our system sends the validation-token only once when the subscription is being created.

I am not an expert in Salesforce framework, but if you can share some code around the webhook implementation (don’t share any sensitive info here), then maybe I can try to help or someone else can help.

View original
Did this thread help you find an answer to your question?

2 replies

PhongVu
Community Manager
Forum|alt.badge.img
  • Community Manager
  • 2282 replies
  • Answer
  • October 21, 2024

If you see the validation-token header and its value in a webhook post request, it means that somehow in your code, the subscription API is called again. Our system sends the validation-token only once when the subscription is being created.

I am not an expert in Salesforce framework, but if you can share some code around the webhook implementation (don’t share any sensitive info here), then maybe I can try to help or someone else can help.


Forum|alt.badge.img
  • Author
  • New Participant
  • 1 reply
  • October 23, 2024

thanks @PhongVu with your anwser my dev team partners on Salesforce where able to make it work.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings