這份文件已更新。
中文(香港) 的翻譯尚未完成。
英文更新時間:11月18日
中文(香港) 更新時間:11月1日

Account

/v1/account

The account node is for registering your WhatsApp Business API client.

Edges

The following edges are connected to this node:

EdgeDescription

/verify

Once you have received the registration code via your specified method, use this edge to complete your account registration.

Before You Start

Authentication Tokens

To use the WhatsApp Business API, you must first authenticate your WhatsApp Business API client with the server and receive a token that enables you to access the service. See the Login and Authentication documentation for more information about authentication.

Phone Number and Certificate

To register, you must have a valid phone number and the base64-encoded certificate associated with that phone number. See the Phone Number guide for information about supported types of phone numbers.

Add Your Phone Number

See Connect Your Phone Number to Your WhatsApp Business Account for instructions on adding a phone number to your WhatsApp business account. A display name assigned to a phone number must be approved by the WhatsApp team before downloading the base64-encoded certificate.

Copy the Base64-encoded Certificate

A base64-encoded certificate string is generated for you and is used for validation during WhatsApp Business API client registration.

  1. Go to the Business Settings in your Facebook Business Manager.
  2. Click on WhatsApp Accounts under the Accounts menu, then select your WhatsApp Account from the WhatsApp Accounts list, if it isn't already highlighted.
  3. Go to the Settings tab, and click the WhatsApp Manager button.
  4. Under the Phone Numbers tab, you should see your phone numbers listed. Click the View button of the phone number you want the certificate for.
    Get the Certificate
  5. A pop-up dialog will display the certificate string in a gray box. Click Get Certificate.
    Download the Certificate String
  6. Use this certificate string in the cert parameter when registering with the account endpoint.

See the Display Name documentation for more information.

Constraints

  • You must use the admin account to register the application.
  • If you are re-registering your account, the Coreapp needs to be restarted once registration is complete.

Requesting

Make a POST call to this endpoint to request a registration code. In your call, add your phone number and base64-encoded certificate string. You can receive your code via either SMS or voice call.

Example

POST /v1/account

{
    "cc": "your-country-code",
    "phone_number": "your- phone-number-without-country-code",
    "method": "sms" | "voice",
    "cert": "your-verified-name-cert-in-base64",
    "pin": "your-existing-6-digit-pin" # required if two-step verification is enabled
}

Depending on the response received, the registration procedure can be considered complete or require another step to complete. If successful, you receive one of the following HTTP status codes. Follow the instructions that match the response you received:

  • 201 Created — The account already exists. You are already registered, so you do not need to do anything else.
  • 202 Accepted — The account does not exist. Depending on the method selected in the request, check your SMS or voice number for the registration code. This response will include a returned payload that contains the vname decoded from the cert parameter for you to confirm the right display name is being set. If correct, proceed to Completing Your Account Registration to complete registration.
{
  "account": [{
      "vname": "decoded-vname-from-cert"
  }]
}

If any errors are returned, refer to Error and Status Messages for more information.

Parameters

NameDescription

cc

Required.

Numerical country code for the phone number you are registering

phone_number

Required.

Phone number you are registering, without the country code or plus symbol (+).

method

Required.

Method of receiving your registration code
Options: VOICE, SMS

cert

Required.

Base64-encoded certificate.

pin

Optional.

Existing 6-digit PIN — This is only required when two-step verification is enabled on this account.

FAQ

可以,我們可以在您準備好正式使用功能時設定新手機號碼或更改已驗證名稱。

您可以使用免費號碼,前提是該號碼必須包含您所在地點的國碼/區碼。這是因為相同的免費號碼可能適用於兩個不同的國家/地區,如果沒有提供相應的不重複國碼/區碼,我們便無法確定該免費號碼適用於哪個國家/地區。

另外請注意,如果使用免費號碼,使用情況將會較為複雜。在一般情況下,如果您在國碼/區碼所屬國家/地區撥打含有該國碼/區碼的免費號碼,通話將無法接通。也就是說,如果您所在國家/地區的顧客撥打企業聯絡方式所列的電話號碼(含國碼/區碼),他們便無法聯絡您。如果這個問題會為您造成影響,請務必明確告知顧客。

請參閱此處的內容,進一步了解有關免費號碼的資訊。

如果您備份了目前的設定,並在新裝置中恢復所有設定,則您的註冊資訊亦會與其餘實作內容一併遷移至新裝置。請參閱備份和恢復設定文件,以了解更多相關資訊。

您可以前往 Facebook 企業管理平台的 WhatsApp 帳戶,以註冊新手機號碼,以及刪除舊手機號碼。

  1. 在 WhatsApp 帳戶中,前往設定
  2. 點擊 WhatsApp 管理工具
  3. 選擇手機號碼標籤頁。您可以在此處管理此帳戶的所有手機號碼。

如果您在使用「短訊」註冊時,因嘗試次數過多而導致失敗,並且看到「存取遭拒」訊息,則請使用「語音通話」方式來註冊

很遺憾,您必須使用另一個可以接收短訊或語音電話的手機號碼,我們才可向您傳送註冊代碼。我們以前允許用戶使用手動註冊代碼,但現在已不再支援此服務。我們會按需要繼續向之前使用手動註冊代碼的手機號碼提供支援服務。若是任何新手機號碼,我們僅會透過短訊或語音通話的形式向您傳送註冊代碼。

如果您想使用 1800 或免費號碼,請閱讀此指南