Versão Graph API

Whats App Business Account Assigned Users

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

Para encontrar a ID de uma conta do WhatsApp Business, acesse Gerenciador de Negócios > Configurações do negócio > Contas > Contas do WhatsApp Business. Encontre a conta que você quer usar e clique nela. Um painel é aberto, contendo as informações sobre a conta, inclusive a ID.

Leitura

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"
    }
  }
}

Parâmetros

ParâmetroDescrição
business
numeric string

business

Obrigatório

Campos

A leitura desta borda retornará um resultado formatado em JSON:

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

data

Uma lista de nós AssignedUser.

Os seguintes campos serão adicionados a cada nó que for retornado:

CampoDescrição
tasks
list<string>

Tasks the user has on the WABA

paging

Para saber mais detalhes sobre paginação, consulte o Guia da Graph API.

summary

Informações agregadas sobre a borda, como contagens. Especifique os campos a serem buscados no parâmetro de resumo (como summary=total_count).

CampoDescrição
total_count
unsigned int32

Total count

Error Codes

ErroDescrição
100Invalid parameter

Criando

Não é possível executar esta operação neste ponto de extremidade.

Atualizando

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

Parâmetros

ParâmetroDescrição
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

Obrigatório
user
UID

Business user ID

Obrigatório

Return Type

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

Error Codes

ErroDescrição
100Invalid parameter
200Permissions error
80008There have been too many calls to this WhatsApp Business account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.

Excluindo

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

Parâmetros

ParâmetroDescrição
user
UID

Business user ID

Obrigatório

Return Type

Struct {
success: bool,
}

Error Codes

ErroDescrição
100Invalid parameter