Phiên bản API Đồ thị

Product Catalog Assigned Users

Đọc

ProductCatalogAssignedUsers

Permissions

  • ads_management
  • catalog_management

Ví dụ

Graph API Explorer
GET /v19.0/{product-catalog-id}/assigned_users HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{product-catalog-id}/assigned_users',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{product-catalog-id}/assigned_users",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{product-catalog-id}/assigned_users",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{product-catalog-id}/assigned_users"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
Nếu bạn muốn tìm hiểu cách sử dụng API Đồ thị, hãy đọc Hướng dẫn sử dụng API Đồ thị của chúng tôi.

Thông số

Thông sốMô tả
business
business ID

The business associated with this catalog

Bắt buộc

Trường

Đọc từ cạnh này sẽ trả về một kết quả JSON đã định dạng:

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

data

Danh sách nút AssignedUser.

Các trường sau sẽ được thêm vào mỗi nút trả về:

TrườngMô tả
permitted_tasks
list<string>

Tasks that are assignable on this object

tasks
list<string>

All unpacked roles/tasks of this particular user on this object

paging

Để biết thêm chi tiết về chia trang, hãy xem hướng dẫn về API Đồ thị.

summary

Thông tin tổng hợp về cạnh, chẳng hạn số lượng. Hãy chỉ định các trường để tìm nạp trong thông số tóm tắt (như summary=total_count).

TrườngMô tả
total_count
unsigned int32

Total number of business and system users assigned to this catalog

Mã lỗi

LỗiMô tả
2635You are calling a deprecated version of the Ads API. Please update to the latest version.
100Invalid parameter
368The action attempted has been deemed abusive or is otherwise disallowed

Tạo

Bạn có thể tạo yêu cầu POST đến cạnh assigned_users từ các đường dẫn sau:
Khi đăng lên cạnh này, hệ thống sẽ tạo a ProductCatalog.

Permissions

  • catalog_management

Thông số

Thông sốMô tả
tasks
array<enum {MANAGE, ADVERTISE, MANAGE_AR, AA_ANALYZE}>

Catalog permission tasks to assign this user

Bắt buộc
user
UID

Business user id or system user id

Bắt buộc

Kiểu trả về

Điểm cuối này hỗ trợ đọc sau khi ghi và sẽ đọc nút mà bạn đã đăng vào đó.
Struct {
success: bool,
}

Mã lỗi

LỗiMô tả
100Invalid parameter
415Two factor authentication required. User have to enter a code from SMS or TOTP code generator to pass 2fac. This could happen when accessing a 2fac-protected asset like a page that is owned by a 2fac-protected business manager.
200Permissions error

Cập nhật

Bạn không thể thực hiện thao tác này trên điểm cuối này.

Xóa

Bạn có thể hủy liên kết a ProductCatalog khỏi a ProductCatalog bằng cách thực hiện yêu cầu DELETE đến /{product_catalog_id}/assigned_users.

Thông số

Thông sốMô tả
user
UID

Business user id or system user id

Bắt buộc

Kiểu trả về

Struct {
success: bool,
}

Mã lỗi

LỗiMô tả
100Invalid parameter