Graph API Version

    Whats App Business Account Assigned Users

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

    To find the ID of a WhatsApp Business Account, go to Business Manager > Business Settings > Accounts > WhatsApp Business Accounts. Find the account you want to use and click on it. A panel opens, with information about the account, including the ID.

    Reading

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

    Parameters

    ParameterDescription
    business
    business id ID

    business

    Required

    Fields

    Reading from this edge will return a JSON formatted result:

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

    data

    A list of AssignedUser nodes.

    The following fields will be added to each node that is returned:

    FieldDescription
    tasks
    list<string>

    Tasks the user has on the WABA

    paging

    For more details about pagination, see the Graph API guide.

    summary

    Aggregated information about the edge, such as counts. Specify the fields to fetch in the summary param (like summary=total_count).

    FieldDescription
    total_count
    unsigned int32

    Total count

    Error Codes

    ErrorDescription
    100Invalid parameter
    200Permissions error
    190Invalid OAuth 2.0 Access Token

    Creating

    You can't perform this operation on this endpoint.

    Updating

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

    Parameters

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

    Permissions on WhatsApp Business Account

    Required
    user
    UID

    Business user ID

    Required

    Return Type

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

    Error Codes

    ErrorDescription
    100Invalid parameter
    200Permissions error

    Deleting

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

    Parameters

    ParameterDescription
    user
    UID

    Business user ID

    Required

    Return Type

    Struct {
    success: bool,
    }

    Error Codes

    ErrorDescription
    200Permissions error