管理您的商家資產群組,並瞭解如何將商家用戶連結到資產群組。商家資產群組可協助大型廣告商或代理商有效率地管理其商家的用戶和資產。您應該以對應現實世界運作的方式來組織資產和用戶。例如,商家可以根據品牌、地區、客戶或自選的組織原則來建構其資產和用戶。
商家資產群組可以包含廣告帳號、粉絲專頁、Facebook 像素、離線事件組合、應用程式、目錄、自訂轉換和 Instagram 帳號。這些資產可以由商家擁有,也可以分享以提供存取權限給代理商。
若要取得與商家相關聯的資產群組清單,請傳送 GET
要求至 BusinessBusinessAssetGroups
端點。
curl -i -X GET "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ID>/business_asset_groups ?access_token=<ACCESS_TOKEN>"
{ "data": [ { "id": "BUSINESS-ID", "name": "Northern Region" }, { "id": "BUSINESS-ID", "name": "Western Region" } ], .... }
若要取得特定商家資產群組的詳細資訊,請傳送 GET
要求至 BusinessAssetGroup
端點。
curl -i -X GET "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID> ?access_token=<ACCESS_TOKEN>"
{ "id": "BUSINESS-ASSET-GROUP-ID", "name": "BUSINESS-ASSET-GROUP-NAME" }
若要將特定資產群組重新命名,請傳送 POST
要求至 BusinessAssetGroup
端點,並將 name
設為新的值。
curl -i -X POST "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID> ?name=BUSINESS-ASSET-GROUP-NAME &access_token=<ACCESS_TOKEN>"
"success": "true"
若要刪除特定資產群組,請傳送 DELETE
要求至 BusinessAssetGroup
端點。
curl -i -X DELETE "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID> ?access_token=<ACCESS_TOKEN>"
"success": "true"
公開的用戶欄位,適用於在已認領應用程式的商家中具有角色的用戶。
如需可讀取的用戶欄位清單,請參閱商家資產用戶個人檔案存取權限參考資料。
若要查看商家範圍用戶可以存取的所有商家資產群組列表,請傳送 GET
要求至 BusinessScopedUser/AssignedBusinessAssetGroups
端點。
curl -i -X GET "https://graph.facebook.com/<API_VERSION>/<BUSINESS_SCOPED_USER_ID>/assigned_business_asset_groups ?limit=1 &access_token=<ACCESS_TOKEN>"
回應包含定義用戶對每種資產類型存取層級的角色:
{ "data": [ { "id": "BUSINESS-ID" "name": "USER NAME", "page_roles": [ "ANALYZE", "ADVERTISE" ], "offline_conversion_data_set_roles": ["UPLOAD"], "adaccount_roles": ["ANALYZE", "ADVERTISE"], "pixel_roles": ["ANALYZE", "EDIT"] } ], .... }
若要讀取為資產群組指派的用戶清單,請傳送 GET
要求至 BusinessAssetGroupAssignedUsers
端點。
curl -i -X GET "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/assigned_users ?limit=2 &business=<BUSINESS_ID> &access_token=<ACCESS_TOKEN>"
{ "data": [ { "id": "BUSINESS-ID", "name": "Dabney Donigan", "page_roles": [ "ANALYZE" ], "offline_conversion_data_set_roles": [ "ADVERTISE", "UPLOAD", "MANAGE" ], "adaccount_roles": [ "ANALYZE" ], "pixel_roles": [ "ANALYZE", "EDIT" ] } ], .... }
若要將用戶指派至商家資產群組,請傳送 POST
要求至 BusinessAssetGroupAssignedUsers
端點。
curl -i -X POST "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/assigned_users ?business=<BUSINESS_ID> &user=USER-ID &page_roles=LIST-OF-PAGE-ROLES &adaccount_roles=LIST-OF-AD-ACCOUNT-ROLES &pixel_roles=LIST-OF-PIXEL-ROLES &offline_conversion_data_set_roles=LIST-OF-OFFLINE-CONVERSION-ROLES &access_token=<ACCESS_TOKEN>"
"success": "true"
若要從群組移除用戶,請傳送 POST
要求至 BusinessAssetGroup
端點。
curl -i -X DELETE \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/assigned_users ?business=<BUSINESS_ID> &user=<USER_ID> &access_token=<ACCESS_TOKEN>"
"success": "true"