We are sunsetting On-Premises API. Refer to our On-Premises API Sunset document for details, and to learn how to migrate to our next-generation Cloud API.
Use this endpoint to manage your certificates if the Webhook URL as configured in the application settings uses an internal Certificate Authority (CA) cert.
Use this endpoint to retrieve your webhook CA certificate.
Request:
GET /v1/certificates/webhooks/ca
Response:
Content-Type: text/plain Content-Length: content-size
certificate
If no certificate is found, a 404
response code is returned with no body.
If the Webhook URL as configured in the application settings uses an internal CA cert, you need to upload it to the WhatsApp Business API client so that it can be supported by the WhatsApp Business API. If you are using an externally known CA cert, you can safely skip this section.
You can generate a self-signed certificate in the PEM format by running:
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
The certificate file needs to be in the PEM format. If you have more than one certificate to upload, they should first be combined into a single file by concatenating them:
cat cert1.pem cert2.pem > bundle.pem
Request:
POST /v1/certificates/webhooks/ca Content-Type: text/plain Content-Length: content-size
certificate
If you need to send the certificate over cURL
, it should look like the following:
curl -X POST \ https://your-webapp-hostname:your-webapp-port/v1/certificates/webhooks/ca \ -H 'Authorization: Bearer your-auth-token' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: text/plain' \ --data-binary @your-path-to-certificate.pem \ -k
If a certificate already exists, it is overwritten. All Coreapp nodes must be restarted after uploading the certificate for the changes to take effect.
The response looks like this:
null or {}
Make a DELETE
request to this endpoint to delete your CA certificate.
Request:
DELETE /v1/certificates/webhooks/ca
Response:
null or {}