Update a WhatsApp Number Details
PUT Method
The Update a WhatsApp Number Details API is used to update the approved WhatsApp number details. This API is an extension to the User Interface feature of Editing WA Number Details.
You can edit the following details of your number via an API using:
- Incoming URL (“incoming_url“)
- Image ("display_image")
- Address ("address")
- Business Description ("business_description")
- Business Category - Exact String match accepted Case insensitive ("business_catregory")
- Contact Email ("contact_email")
- Website ("website")
- About ("about")
Notes:
- All the fields are optional and any field added to the API will be automatically updated.
- The wa_number is a mandatory field. You can address at least one editable field.
- You cannot leave the display_image field, empty and the rest of the fields need to be automatically updated.
Base URL
<https://api.kaleyra.io/v1/><SID>
To update WhatsApp number details, perform the following steps:
- Signup or Login to Kaleyra.io and create your API key.
Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID.
Note:
After you sign up, your account will be on the trial version. You must complete the KYC to access all the features in Kaleyra.io.
Prerequisite:
- A WhatsApp business number.
- An associated profile with the business number.
- A WhatsApp verified and approved profile.
For more details, read what WhatsApp has to say about creating a business account.
- API command to Update WhatsApp Number Details.
API Request to Update WhatsApp Number Details
To update WhatsApp number details, use the /whatsapp/number endpoints.
Request Format
The following is the request format to update a WhatsApp number details:
curl --location --request PUT 'https://api.in.kaleyra.io/v1/<sid>/whatsapp/number' \
--header 'api-key: <api_key>' \
--header 'Content-Type: <content_type>' \
--data-raw '{
"wa_number": "<wa_number>",
"address": "<address>",
"incoming_url": "<incomming_url>",
"display_image": "<display_image>",
"business_description": "<business_description>",
"business_category": "<business_category>",
"website": "<website>",
"contact_email": "<contact_email>",
"about": "<about>"
}'
Sample Request Format
The following is the sample request format to update a WhatsApp number details:
curl --location --request PUT 'https://api.in.kaleyra.io/v1/HXXXXXXX071US/whatsapp/number' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3' \
--header 'Content-Type: application/json' \
--data-raw '{
"wa_number": "+91XXXXXXXXXX",
"address": "567, "john", 2nd Phase, Bangalore.",
"incoming_url": "https://webhook.site/XXXXXXXX-c96d-XXXX-b7a8-XXXXXXXXXXXX",
"display_image": "https://s3.eu-central-1.amazonaws.com/kcloud.sms-eu/docs/1XXXXXXXXXX632315661538_XXXXXXXX-6faa-4XXX-b06e-2af311229c83.jpg",
"business_description": "Brief description about the Company",
"business_category": "Hotel and Lodging",
"website": "http://www.tested.com",
"contact_email": "[email protected]",
"about": "Today we tested sample212"
}'
Parameters and Data Types
The following is the list of parameters and data types supported to update a WhatsApp Number Details:
Parameter | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
sid | String | Account SID (Security Identifier). Generated by Kaleyra.io while creating an API key. | HXXXXXXX071US | Yes |
api-key | String | API key generated from kaleyra.io account. | Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3 | Yes |
content_type | Alphanumeric | Indicates the format of the content the API will be processing. | application/JSON | Yes |
wa_number | String | Specifies the registered WhatsApp number in E164 format. | +91XXXXXXXXXX | Yes |
address | String | Specifies registered WhatsApp number address. | 567, "john", 2nd Phase, Bangalore. | No |
incomming_url | String | Specifies the URL for which you receive the incoming callback. | https://webhook.site/#!/7aXXXXXX-e1df-4f59-8ddc-55abdaXXXXXX/test | No |
display_image | String | Specifies registered WhatsApp display image. | https://s3.ap-south-1.amazonaws.com/stage-hexa/docs/1620380334flower-729512__340.jpg | No |
business_description | String | Specifies registered WhatsApp number business description. | Brief description about the Company | No |
business_category | String | Specifies the registered WhatsApp number business category. The following are the values accepted for Business Category: a) Automotive b) Beauty, Spa, and Salon c) Clothing and Apparel d) Education e)Entertainment f) Event Planning and Service g) Finance and Banking h) Food and Grocery i) Public Service j) Hotel and Lodging k) Medical and Health l) Non-profit m) Professional Services n) Shopping and Retail o) Travel and Transportation p) Restaurant q) Other | Hotel and Lodging | No |
website | String | Specifies the business website. | https://www.kaleyra.com | No |
contact_email | String | Specifies the registered WhatsApp number contact Email. | [email protected] | No |
about | String | Specifies the brief description. | Today we tested sample212 | No |
Sample Success Response
This section provides you the successful JSON response format.
{
"status": 200,
"message": "WA Phone number update successfully.",
"data": [],
"error": {}
}
Sample Failure Response
The wa_number is a mandatory field and cannot be empty. Pass the wa_number key and value.
{
"error": {
"code": "E413",
"type": "VALIDATION_ERROR",
"parameter": "wa_number",
"message": "wa_number field is required and cannot be empty.",
"reference": ""
}
}
The display_image cannot be empty. Pass the appropriate value, else do not pass the key.
{
"error": {
"code": "E962",
"type": "VALIDATION_ERROR",
"parameter": "display_image",
"message": "display_image cannot be empty",
"reference": ""
}
}
Updated about 1 month ago