Register the webhook call in Webhook Entries and start synchronous or asynchronous processing of the webhook (type of procesing depends on webhook endpoint settings, field Asynchronous Processing).
Record "API Endpoint RWU"
– Specifies the webhook settings record. Function will create a new Webhook Entry and attach it to the selected endpoint.Text
– Specifies the webhook request JSON body. Based on parameter _IsBase64Encoded it can be plain JSON or Base64-encoded JSON.Text
– Function will return response JSON body in this parameter.Boolean
– Specifies, if the request payload is Base64-Encoded or just plain JSON.Record "API WebHook Entry RWU"
– Specifies existing webhook entry. It should have already filled field Endpoint System Id and RESTwithUS will fill the rest of information there (request JSON body etc.) and start processing.Text
– Specifies the webhook request JSON body. Based on parameter _IsBase64Encoded it can be plain JSON or Base64-encoded JSON.Text
– Function will return response JSON body in this parameter.Boolean
– Specifies, if the request payload is Base64-Encoded or just plain JSON.var
APIEndpointRWU: Record "API Endpoint RWU";
ProviderID: Enum "Provider ID RWU";
WebhookID: Enum "WebHook ID RWU";
//Handle webhook that expects Base64 encoded body
APIEndpointRWU := APIScriptRWU.GET_WEBHOOK_RECORD(ProviderID::TestProvider,WebhookID::"Default API Page");
ApiScript.HANDLE_WEBHOOK_CALL(APIEndpointRWU,'{"payloadBase64Body": "ewogICAgImlkIjogMSwKICAgICJubyI6ICIwMTEyMTIxMiIsCiAgICAibmFtZSI6ICJTcG90c21leWVyJ3MgRnVybmlzaGluZ3MiCn0="}',ResponseBase64Body,true);
//Handle webhook that expects non-Base64 encoded body
APIEndpointRWU := APIScriptRWU.GET_WEBHOOK_RECORD(ProviderID::TestProvider,WebhookID::"Test Custom API Page");
ApiScript.HANDLE_WEBHOOK_CALL(APIEndpointRWU,'{ "id": 1, "no": "01121212", "name": "Spotsmeyer''s Furnishings" }',ResponseBase64Body,false);