openssl genrsa -des3 -out private.pem 2048
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
openssl x509 -pubkey -noout -in private.pem > public.pem
POST request to /PHONE_NUMBER_ID/whatsapp_business_encryption.
In your call, include the 2048-bit RSA key you generated. If you have multiple phone numbers linked to a WABA, this API must be called to sign the business public key for each phone number.| Endpoint | Authentication |
|---|---|
/PHONE_NUMBER_ID/whatsapp_business_encryption | Authenticate yourself with a system user access token and you must have the whatsapp_business_messaging permission.
If you are requesting the code on behalf of another business, the access token needs to have Advanced Access to the whatsapp_business_messaging permission. |
| Name | Description |
|---|---|
business_public_keystring | Required. 2048-bit RSA business public key generated. |
curl -X POST \
'https://graph.facebook.com/v25.0/PHONE_NUMBER_ID/whatsapp_business_encryption' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'business_public_key=BUSINESS_PUBLIC_KEY'
curl -X POST \
'https://graph.facebook.com/v25.0/PHONE_NUMBER_ID/whatsapp_business_encryption' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'business_public_key=-----BEGIN PUBLIC KEY-----
AAA
BBB
CCC
DDD
EEE
FFF
GGG
-----END PUBLIC KEY-----'
200 and the payload:{ "success": true }
GET request to /PHONE_NUMBER_ID/whatsapp_business_encryption.| Endpoint | Authentication |
|---|---|
/PHONE_NUMBER_ID/whatsapp_business_encryption | Authenticate yourself with a system user access token and you must have the whatsapp_business_messaging permission.
If you are requesting the code on behalf of another business, the access token needs to have Advanced Access to the whatsapp_business_messaging permission. |
| Name | Description |
|---|---|
business_public_keystring | Stored 2048-bit RSA business public key. |
business_public_key_signature_statusstring | Status of stored 2048-bit RSA business public key. |
curl -X GET \
'https://graph.facebook.com/v25.0/PHONE_NUMBER_ID/whatsapp_business_encryption' \
-H 'Authorization: Bearer ACCESS_TOKEN'
{ "business_public_key": "<2048_bit_RSA_key>" "business_public_key_signature_status": VALID | MISMATCH }