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|N10]|validationToken|String|false|false 12:47:02.1 (14204992)|VARIABLE_ASSIGNMENT|E10]|validationToken|null 12:47:02.1 (14208322)|STATEMENT_EXECUTE|E11] 12:47:02.1 (14209696)|STATEMENT_EXECUTE|E17] 12:47:02.1 (14244104)|HEAP_ALLOCATE|_17]|Bytes:863 12:47:02.1 (14248825)|VARIABLE_SCOPE_BEGIN|S17]|requestBody|String|false|false 12:47:02.1 (14254993)|VARIABLE_ASSIGNMENT|L17]|requestBody|"{\"uuid\":\"80248989911 (843 more) ..." 12:47:02.1 (14257582)|STATEMENT_EXECUTE|A18] 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|818]|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":3{"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|I10]|validationToken|"827889c7-f82b-40ef-9 (16 more) ..."
09:36:00.1 (12401186)|STATEMENT_EXECUTE|T11]
09:36:00.1 (12402099)|STATEMENT_EXECUTE|T12]
09:36:00.1 (12403634)|HEAP_ALLOCATE|412]|Bytes:27
09:36:00.1 (12406889)|HEAP_ALLOCATE|912]|Bytes:63
09:36:00.1 (12421581)|USER_DEBUG|112]|DEBUG|Validation-Token Received: 827889c7-f82b-40ef-986f-5fe569fb85ac
09:36:00.1 (12425793)|STATEMENT_EXECUTE|T13]
09:36:00.1 (12451169)|STATEMENT_EXECUTE|T14]
09:36:00.1 (12465024)|METHOD_ENTRY|214]||System.RestResponse.addHeader(String, String)
09:36:00.1 (12539640)|METHOD_EXIT|614]||System.RestResponse.addHeader(String, String)
09:36:00.1 (12544025)|STATEMENT_EXECUTE|T15]
09:36:00.1 (12610999)|HEAP_ALLOCATE|915]|Bytes:4
09:36:00.1 (12645027)|STATEMENT_EXECUTE|T17]
09:36:00.1 (12674189)|VARIABLE_SCOPE_BEGIN|A17]|requestBody|String|false|false
09:36:00.1 (12681805)|VARIABLE_ASSIGNMENT|I17]|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:
- We have confirmed that the validation token is processed correctly.
- We have updated our code to handle the validation token separately, ensuring the correct token is sent back to pass the validation phase.
- 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.