API Graph versión

Whats App Business Account Assigned Users

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

Para encontrar el identificador de la cuenta de WhatsApp Business, ve al administrador comercial > Configuración del negocio > Cuentas > Cuentas de WhatsApp Business. Busca la cuenta que deseas usar y haz clic en ella. Se abre un panel con información de la cuenta, incluido el identificador.

Lectura

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ámetroDescripción
business
numeric string

business

Obligatorio

Campos

La lectura de este perímetro mostrará un resultado con formato JSON:

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

data

Una lista de nodos AssignedUser.

Los siguientes campos se agregarán a cada nodo devuelto:

CampoDescripción
tasks
list<string>

Tasks the user has on the WABA

paging

Para obtener más detalles sobre la paginación, consulta la guía de la API Graph.

summary

Información total sobre el perímetro, por ejemplo, los recuentos. Especifica los campos que quieres recuperar en el parámetro "summary" (como en summary=total_count).

CampoDescripción
total_count
unsigned int32

Total count

Error Codes

ErrorDescripción
100Invalid parameter
200Permissions error

Creación

No puedes realizar esta operación en este extremo.

Actualizando

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

Parámetros

ParámetroDescripción
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

Obligatorio
user
UID

Business user ID

Obligatorio

Return Type

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

Error Codes

ErrorDescripción
100Invalid parameter
200Permissions error

Eliminando

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

Parámetros

ParámetroDescripción
user
UID

Business user ID

Obligatorio

Return Type

Struct {
success: bool,
}

Error Codes

ErrorDescripción
100Invalid parameter
200Permissions error