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.

Webhooks Certificate Authority Certificates

Use this endpoint to manage your certificates if the Webhook URL as configured in the application settings uses an internal Certificate Authority (CA) cert.

Retrieving

Use this endpoint to retrieve your webhook CA certificate.

Example

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.

Uploading

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

Example

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 {}

Deleting

Make a DELETE request to this endpoint to delete your CA certificate.

Example

Request:

DELETE /v1/certificates/webhooks/ca

Response:

null or {}