procedure SendCustomerToSupportDesk(Customer: Record Customer)
var
Client: HttpClient;
Request: HttpRequestMessage;
Response: HttpResponseMessage;
Content: HttpContent;
JsonPayload: Text;
begin
JsonPayload := '{ "name": "' + Customer.Name + '", "email": "' + Customer."E-Mail" + '" }';
Content.WriteFrom(JsonPayload);
Content.GetHeaders().Add('Content-Type', 'application/json');
Request.SetRequestUri('https://your-supportdesk-api.com/customers');
Request.Method := 'POST';
Request.Content := Content;
Request.GetHeaders().Add('Authorization', 'Bearer your_token_here');
if Client.Send(Request, Response) then
Message('Customer sent successfully!')
else
Error('Failed to send customer. Status: %1', Response.HttpStatusCode());
end;
Key Points:
- Replace the URL and token with your actual API endpoint and credentials.
- Ensure the Customer record contains the required fields.
- You do not need an Azure Function unless the external API has specific constraints or security requirements.
Let me know if this helps, and please mark the response as helpful if it answered your question 😊
Best regards!