Set Shards
POST {{URL}}/v1/account/shards
The WhatsApp Business API Client uses sharding to achieve multiconnect. Depending on the number of shards you set up, the database stores a shard map that determines which shard a message should go to depending on the recipient ID (or WhatsApp username). The function to determine this is:
shard_id = hash(recipient-id) % shard-number
Response Parameters
| Name | Description |
|---|---|
ccType: String | Required. The country code for the phone number registered for this WhatsApp Business API Client as a string. For example: "1". |
phone_numberType: String | Required. The phone number registered for this WhatsApp Business API Client without the country code or plus symbol (+) as a string. For example: "6315550000". |
shardsType: Integer | Required. The number of shards you want to have as an integer. Options: 1, 2, 4, 8, 16, or 32 |
pinType: String | Optional. The existing 6-digit PIN for two-factor verification as a string. For example: "123456". This is only required if you have two-factor verification enabled on this account. |
certType: String | Required. A Base64-encoded certificate associated with the phone number previously specified. You can get this certificate using Business Manager. See Copy the Base64-encoded Certificate for information. Notes:
|
Response
If successful, the API call returns 201 Created : You successfully changed shard number.
If not successful, The API call returns 403 Forbidden : You could hit this if server is temporarily unavailable, retry the request should fix it.
Troubleshooting
If there has been more than 7 days since you registered your phone number, the set shards API request will disconnect your phone number.
Request Body
{"cc"=>"{{Country-Code}}", "phone_number"=>"{{Phone-Number}}", "shards"=>"1 | 2 | 4 | 8 | 16 | 32", "pin"=>"{{Two-Step-PIN}}", "cert"=>"<your-verified-name-cert-in-base64>"}
HEADERS
| Key | Datatype | Required | Description |
|---|---|---|---|
Content-Type | string | ||
Authorization | string |
RESPONSES
status: Created
"201 Created : You successfully changed shard number "