我們即將停用內部部署 API。請參閱我們的內部部署 API 停用文件以取得詳細資訊,並瞭解如何轉移到我們的新一代雲端 API。
/v1/users
Use the users
node for managing authentication and accessing the WhatsApp Business On-Premises API Client.
The WhatsApp Business On-Premises API Client has a default account with admin
set as the username with a password of secret
. This account cannot be removed or deleted from the system. For security reasons, you are required to change the admin password immediately.
If you forget your password, please contact Direct Support for assistance with resetting it.
admin
account can create or delete users.admin
account only to create or delete usersTo create an account for a user within your business who can access the WhatsApp Business API, send the username and password to the WhatsApp Business On-Premises API Client using the /users
endpoint. It validates the username and password and creates a new account if one does not already exist for that username. The password is processed with a one-way hash and stored in a data volume. Both username
and password
are required parameters.
To create a user, send a request like:
POST /v1/users Authorization: Bearer your-auth-token { "username": "username", "password": "password" }
If the request is successful and a user account is created, you receive an HTTP status code of 201 Created
and the following payload:
{ "users": [{ "username": "username" }] }
If the request is not successful, you receive an HTTP status code, along with a WhatsApp error code. If you submit a duplicate username, the error response looks like this:
{ "errors": [{ "code": 1014, "title": "Internal error", "details": "Unable to create user. Already exist?" }] }
Name | Description |
---|---|
| Required. Must be a minimum of 4 characters and a maximum of 32 characters. |
| Required. Must be between 8 and 64 characters and at least one character must be upper-case, lower-case, a digit, and a special character:
!\/'"#$%&()*+-.,:;_<>=?@[]{}^`|~
|
| Required. Authentication token for the administrator who is running the request. See Login and Authentication — Tokens documentation for more information. |
The following edges are connected to this node:
Edge | Description |
---|---|
Use this edge to login to the WhatsApp Business On-Premises API Client. | |
Use this edge to logout of the WhatsApp Business On-Premises API Client. | |
Use this edge to retrieve, update, or delete a user account. |
HTTP Status Code | Reason |
---|---|
|
Submit the request again with an appropriate length username/password. |
| You are not using the |
| Unable to create the account, possibly because it already exists. |
If there are other errors in the response, refer to the following sources for more information: Error Codes and HTTP Status Codes.