Tài liệu này đã được cập nhật.
Bản dịch sang Tiếng Việt chưa hoàn tất.
Cập nhật bằng tiếng Anh: 17 tháng 12
Đã cập nhật bằng Tiếng Việt: 5 tháng 10, 2022

Manage System Users

Adding your System User to shared WhatsApp Business Accounts allows you to programmatically manage the accounts. On this guide, we go over actions BSPs may need to perform to manage their system users.

Retrieve System User IDs

You can cache the System User IDs for future use.

Request

curl -i -X GET "https://graph.facebook.com/v21.0/{business-id}/system_users
  ?access_token={system-user-access-token}"
To find the ID of a business, go to Business Manager > Business Settings > Business Info. There, you will see information about the business, including the ID.

Response

{
  "data": [
    {
      "id": "1972555232742222",
      "name": "My System User",
      "role": "EMPLOYEE"
    }
  ]
}

Add System Users to a WhatsApp Business Account

For this API call, you need to use the access token of a System User with admin permissions.

Request

In the following example, use the ID for the assigned WABA.

curl -i -X POST "https://graph.facebook.com/v21.0/{waba-id}/assigned_users
  ?user={assigned-user-id}
  &tasks=['{your-permissions or tasks}']
  &access_token={admin-system-user-access-token}"
Để tìm ID của một Tài khoản WhatsApp Business, hãy chuyển đến Trình quản lý kinh doanh > Cài đặt cho doanh nghiệp > Tài khoản > Tài khoản WhatsApp Business. Tìm tài khoản bạn muốn dùng rồi nhấp vào tài khoản đó. Một bảng điều khiển sẽ mở ra có chứa thông tin về tài khoản, bao gồm cả ID.

For the assigned-user-id, use the system user ID returned from your /{business-id}/system_users call.

Permissions

NameDescription

MANAGE**

Provides admin access.
Users can have admin access on a WhatsApp Business Account that is shared with Admin permissions.

DEVELOP

Provides developer access.
Users can have developer access on a WhatsApp Business Account that is shared with Standard permissions.

**Note: If you are trying to add a user to a WhatsApp Business Account that is shared with you via a Multi-Partner Solution you would have to use MANAGE_USERS to add the user to that account.

Response

{
  "success": true
}

Retrieve assigned users

You can fetch the assigned users of the WhatsApp Business Account to verify that the user was added. This is not a required step but helps with validation.

Request

In the following example, use the ID for the assigned WABA.

curl -i -X GET "https://graph.facebook.com/v21.0/{waba-id}/assigned_users
  ?business={business-id}
  &access_token={system-user-access-token}"

Response

{
  "data": [
    {
      "id": "1972385232742142",
      "name": "Anna Flex",
      "tasks": [
        "MANAGE"
      ]
    },
    {
      "id": "1972385232752545",
      "name": "Jasper Brown",
      "tasks": [
        "DEVELOP"
      ]
    }
  ]
}

See Also