Versi Graph API

Whats App Business Account Assigned Users

Represents users assigned to a specific WhatsApp Business Account (WABA).

Untuk menemukan ID Akun WhatsApp Business, buka Pengelola BisnisPengaturan Bisnis> AkunAkun WhatsApp Business. Temukan akun yang ingin Anda gunakan dan klik akunnya. Panel akan terbuka, dengan informasi tentang akun, termasuk ID.

Membaca

Returns the WhatsApp Business Account's assigned users.

Example

Requirements

  • whatsapp_business_management permission

  • whatsapp_business_messaging permission

  • public_profile permission

  • BUSINESS ID (also referred to as BUSINESS MANAGER ID in Business Settings)

  • WhatsApp Business Account (WABA) ID

  • USER ACCESS TOKEN

Request

curl -i -X GET \
 "https://graph.facebook.com/LATEST-VERSION/WHATSAPP-BUSINESS-ACCOUNT-ID/assigned_users?
        business=BUSINESS-ID&
        access_token=USER-ACCESS-TOKEN"
GraphRequest request = GraphRequest.newGraphPathRequest(
  accessToken,
  "/WHATSAPP-BUSINESS-ACCOUNT-ID/assigned_users",
  new GraphRequest.Callback() {
    @Override
    public void onCompleted(GraphResponse response) {
      // Insert your code here
    }
});

Bundle parameters = new Bundle();
parameters.putString("business", "BUSINESS-ID");
request.setParameters(parameters);
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
    initWithGraphPath:@"/WHATSAPP-BUSINESS-ACCOUNT-ID/assigned_users"
           parameters:@{ @"business": @"BUSINESS-ID",}
           HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
    // Insert your code here
}];

Response

{
  "data": [
    {
      "id": "ASSIGNED-USER-ID",
      "name": " ",
      "tasks": [
        "MANAGE"
      ]
    }
  ],
  "paging": {
    "cursors": {
      "before": "BEFORE-CURSOR",
      "after": "AFTER-CURSOR"
    }
  }
}

Parameter

ParameterKeterangan
business
numeric string

business

Diperlukan

Kolom

Jika membaca dari edge ini, maka akan mengembalikan hasil berformat JSON:

{ "data": [], "paging": {}, "summary": {} }

data

Daftar dari node AssignedUser.

Kolom berikut ini akan ditambahkan ke masing-masing node yang dikembalikan:

KolomKeterangan
tasks
list<string>

Tasks the user has on the WABA

paging

Untuk perincian selengkapnya tentang penomoran halaman, lihat panduan Graph API.

summary

Informasi agregat tentang edge tersebut, seperti jumlah. Tentukan kolom untuk diambil di parameter ringkasan (seperti ringkasan=total_count).

KolomKeterangan
total_count
unsigned int32

Total count

Error Codes

KesalahanDescription
100Invalid parameter
200Permissions error

Membuat

Anda tidak dapat melakukan operasi ini pada titik akhir ini.

Memperbarui

You can update a WhatsAppBusinessAccount by making a POST request to /{whats_app_business_account_id}/assigned_users.

Parameter

ParameterKeterangan
tasks
array<enum {MANAGE, DEVELOP, MANAGE_TEMPLATES, MANAGE_PHONE, VIEW_COST, MANAGE_EXTENSIONS, VIEW_PHONE_ASSETS, MANAGE_PHONE_ASSETS, VIEW_TEMPLATES, MESSAGING}>

Permissions on WhatsApp Business Account

Diperlukan
user
UID

Business user ID

Diperlukan

Jenis Pengembalian

This endpoint supports read-after-write and will read the node to which you POSTed.
Struct {
success: bool,
}

Error Codes

KesalahanDescription
100Invalid parameter
200Permissions error

Menghapus

You can dissociate a WhatsAppBusinessAccount from a WhatsAppBusinessAccount by making a DELETE request to /{whats_app_business_account_id}/assigned_users.

Parameter

ParameterKeterangan
user
UID

Business user ID

Diperlukan

Jenis Pengembalian

Struct {
success: bool,
}

Error Codes

KesalahanDescription
100Invalid parameter
200Permissions error