You can get, add and delete assets from an asset group. This includes ad accounts, pages, Facebook pixels, offline event sets, app, catalogs, Instagram accounts and custom conversions.
To get a list of all Facebook pages that are in an asset group:
curl -i -X GET \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pages?access_token=<TOKEN>"
The response looks like this:
{ "data": [ { "name": "Sample Name", "id": "<ID>" }, { "name": "Another Name", "id": "<ID>" }, { "name": "Third Name", "id": "<ID>" } ], .... }
You can add a page to an asset group. You can add both owned pages and shared pages:
curl -i -X POST \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pages?asset_id=<ID>&access_token=<TOKEN>"
On success, we return true
.
To delete a page:
curl -i -X DELETE \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pages?asset_id=<ID>&access_token=<TOKEN>"
On success, we return true
.
Business asset groups can contain either owned or shared ad accounts. To read the accounts in a group:
curl -i -X GET \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_adaccounts?access_token=<TOKEN>"
The response looks like this:
{ "data": [ { "account_id": "<ID>", "id": "act_<ID>" }, { "account_id": "<ID>", "id": "act_<ID>" }, { "account_id": "<ID>", "id": "act_<ID>" } ], .... } } }
To add an ad account to an asset group:
curl -i -X POST \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_adaccounts?asset_id=<ID>&access_token=<TOKEN>"
To remove an ad account:
curl -i -X DELETE \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_adaccounts?asset_id=<ID>&access_token=<TOKEN>"
You can add both owned and shared product catalogs to a business asset group. To see all catalogs in a group:
curl -i -X GET \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_product_catalogs?access_token=<TOKEN>"
The response looks like this:
{ "data": [ { "id": "<ID>", "name": "1 product catalog" }, { "id": "<ID>", "name": "First_Catalog_Products" } ], .... }
To add a catalog to an asset group:
curl -i -X POST \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_product_catalogs?asset_id=<ID>&access_token=<TOKEN>"
On success, we return true
. To remove a catalog:
curl -i -X DELETE \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_product_catalogs?asset_id=<ID>&access_token=<TOKEN>"
You can add shared as well as owned Instagram Accounts to a business asset group. To get a list of existing accounts:
curl -i -X GET \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_instagram_accounts?access_token=<TOKEN>"
The response looks like this:
{ "data": [ { "id": "<ID>" }, { "id": "<ID>" } ], .... }
To add an Instagram Account:
curl -i -X POST \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_instagram_accounts?asset_id=<ID>&access_token=<TOKEN>"
On success, we return true
.
To remove an account:
curl -i -X DELETE \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_instagram_accounts?asset_id=<ID>&access_token=<TOKEN>"
You can add or remove owned and shared pixels in asset groups. To see all existing pixels in a group:
curl -i -X GET \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pixels?access_token=<TOKEN>"
The response looks like this:
{ "data": [ { "id": "<ID>" }, { "id": "<ID>" } ], .... } } }
To add a pixel to an asset group:
curl -i -X POST \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pixels?asset_id=<ID>&access_token=<TOKEN>"
On success, we return true
.
To remove a pixel:
curl -i -X DELETE \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pixels?asset_id=<ID>&access_token=<TOKEN>"
Business asset groups can contains both shared and owned offline event datasets. To see all datasets in an asset group:
curl -i -X GET \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_offline_conversion_data_sets?access_token=<TOKEN>"
The response looks like this:
{ "data": [ { "id": "<ID>", "name": "Transfer", "business": { "id": "<ID>", "name": "Acme Industries Inc." }, "enable_auto_assign_to_accounts": false, "is_restricted_use": false }, { "id": "<ID>", "name": "Default Offline Event Set For Biz1", "business": { "id": "<ID>", "name": "Biz1" }, "enable_auto_assign_to_accounts": true, "is_restricted_use": false } ], .... }
To add offline event sets to an asset group:
curl -i -X POST \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_offline_conversion_data_sets?asset_id=<ID>&access_token=<TOKEN>"
On success, we return true
.
To remove an event set:
curl -i -X DELETE \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_offline_conversion_data_sets?asset_id=<ID>&access_token=<TOKEN>"
To get all shared and owned apps in an asset group:
curl -i -X GET \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_applications?access_token=<TOKEN>"
The response:
{ "data": [ { "category": "Games", "link": "/instantgames/<ID>/", "name": "testing again", "id": "<ID>" }, { "category": "Lifestyle", "link": "https://www.facebook.com/games/?app_id=<ID>", "name": "AccountKitTest", "id": "<ID>" } ], .... }
To add an app:
curl -i -X POST \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_applications?asset_id=<ID>&access_token=<TOKEN>"
To remove an app:
curl -i -X DELETE \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_applications?asset_id=<ID>&access_token=<TOKEN>"
When you either add or remove an app successfully, we return true
.
To see all owned and shared custom conversions data sets in an asset group:
curl -i -X GET \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_custom_conversions?access_token=<TOKEN>"
The response:
{ "data": [{ "data": [ { "id": "<ID>" }, { "id": "<ID>" } ], .... }
To add custom conversions:
curl -i -X POST \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_custom_conversions?asset_id=<ID>&access_token=<TOKEN>"
To delete custom conversions:
curl -i -X DELETE \ "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_custom_conversions?asset_id=<ID>&access_token=<TOKEN>"
When you successfully add or remove an custom conversions, we return true
.