Assets verwalten

Du kannst Assets aus einer Asset-Gruppe abrufen, ihr Assets hinzufügen und sie daraus löschen. Dazu gehören Werbekonten, Seiten, Facebook-Pixel, Offline-Event-Sets, Apps, Kataloge, Instagram-Konten und selbstdefinierte Conversions.

Seiten

So rufst du eine Liste aller Facebook-Seiten in einer Asset-Gruppe ab:

curl -i -X GET \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pages?access_token=<TOKEN>"

Die Antwort sieht folgendermaßen aus:

{
  "data": [
    {
      "name": "Sample Name",
      "id": "<ID>"
    },
    {
      "name": "Another Name",
      "id": "<ID>"
    },
    {
      "name": "Third Name",
      "id": "<ID>"
    }
  ],
  ....
}

Du kannst einer Asset-Gruppe eine Seite hinzufügen. Du kannst sowohl eigene als auch geteilte Seiten hinzufügen:

curl -i -X POST \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pages?asset_id=<ID>&access_token=<TOKEN>"

Bei Erfolg wird true zurückgegeben.

So löschst du eine Seite:

curl -i -X DELETE \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pages?asset_id=<ID>&access_token=<TOKEN>"

Bei Erfolg wird true zurückgegeben.

Werbekonten

Business-Asset-Gruppen können entweder eigene oder geteilte Werbekonten enthalten. So liest du die Konten in einer Gruppe:

curl -i -X GET \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_adaccounts?access_token=<TOKEN>"

Die Antwort sieht folgendermaßen aus:

{
  "data": [
    {
      "account_id": "<ID>",
      "id": "act_<ID>"
    },
    {
      "account_id": "<ID>",
      "id": "act_<ID>"
    },
    {
      "account_id": "<ID>",
      "id": "act_<ID>"
    }
  ],
....
    }
  }
}

So fügst du einer Asset-Gruppe ein Werbekonto hinzu:

curl -i -X POST \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_adaccounts?asset_id=<ID>&access_token=<TOKEN>"

So entfernst du ein Werbekonto:

curl -i -X DELETE \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_adaccounts?asset_id=<ID>&access_token=<TOKEN>"

Produktkataloge

Du kannst einer Business-Asset-Gruppe sowohl eigene als auch geteilte Produktkataloge hinzufügen. So zeigst du alle Kataloge in einer Gruppe an:

curl -i -X GET \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_product_catalogs?access_token=<TOKEN>"

Die Antwort sieht folgendermaßen aus:

{
  "data": [
    {
      "id": "<ID>",
      "name": "1 product catalog"
    },
    {
      "id": "<ID>",
      "name": "First_Catalog_Products"
    }
  ],
....
}

So fügst du einer Asset-Gruppe einen Katalog hinzu:

curl -i -X POST \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_product_catalogs?asset_id=<ID>&access_token=<TOKEN>"

Bei Erfolg wird true zurückgegeben. So entfernst du einen Katalog:

curl -i -X DELETE \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_product_catalogs?asset_id=<ID>&access_token=<TOKEN>"

Instagram-Konten

Du kannst einer Business-Asset-Gruppe sowohl geteilte als auch eigene Instagram-Konten hinzufügen. So rufst du eine Liste der bestehenden Konten ab:

curl -i -X GET \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_instagram_accounts?access_token=<TOKEN>"

Die Antwort sieht folgendermaßen aus:

{
  "data": [
    {
      "id": "<ID>"
    },
    {
      "id": "<ID>"
    }
  ],
  ....
}

So fügst du ein Instagram-Konto hinzu:

curl -i -X POST \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_instagram_accounts?asset_id=<ID>&access_token=<TOKEN>"

Bei Erfolg wird true zurückgegeben.

So entfernst du ein Konto:

curl -i -X DELETE \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_instagram_accounts?asset_id=<ID>&access_token=<TOKEN>"

Facebook-Pixel

Du kannst eigene oder geteilte Pixel in Asset-Gruppen hinzufügen oder entfernen. So zeigst du alle bestehenden Pixel in einer Gruppe an:

curl -i -X GET \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pixels?access_token=<TOKEN>"

Die Antwort sieht folgendermaßen aus:

{
  "data": [
    {
      "id": "<ID>"
    },
    {
      "id": "<ID>"
    }
  ],
 ....
    }
  }
}

So fügst du einer Asset-Gruppe ein Pixel hinzu:

curl -i -X POST \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pixels?asset_id=<ID>&access_token=<TOKEN>"

Bei Erfolg wird true zurückgegeben.

So entfernst du ein Pixel:

curl -i -X DELETE \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_pixels?asset_id=<ID>&access_token=<TOKEN>"

Datensätze zu Offline-Events

Business-Asset-Gruppen können sowohl geteilte als auch eigene Datensätze zu Offline-Events enthalten. So zeigst du alle Datensätze in einer Asset-Gruppe an:

curl -i -X GET \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_offline_conversion_data_sets?access_token=<TOKEN>"

Die Antwort sieht folgendermaßen aus:

{
 "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 } ], 
 ....
 }

So fügst du einer Asset-Gruppe Datensätze zu Offline-Events hinzu:

curl -i -X POST \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_offline_conversion_data_sets?asset_id=<ID>&access_token=<TOKEN>"

Bei Erfolg wird true zurückgegeben.

So entfernst du einen Event-Datensatz:

curl -i -X DELETE \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_offline_conversion_data_sets?asset_id=<ID>&access_token=<TOKEN>"

Apps

So rufst du alle geteilten und eigenen Apps in einer Asset-Gruppe ab:

curl -i -X GET \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_applications?access_token=<TOKEN>"

Antwort:

{
 "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>" } ], 
 ....
 }

So fügst du eine App hinzu:

curl -i -X POST \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_applications?asset_id=<ID>&access_token=<TOKEN>"

So entfernst du eine App:

curl -i -X DELETE \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_applications?asset_id=<ID>&access_token=<TOKEN>"

Wenn du entweder eine App erfolgreich hinzufügst oder entfernst, wird true zurückgegeben.

Custom Conversions

So zeigst du alle eigenen und geteilten Datensätze zu selbstdefinierten Conversions in einer Asset-Gruppe an:

curl -i -X GET \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_custom_conversions?access_token=<TOKEN>"

Antwort:

{
 "data": [{
  "data": [
    {
      "id": "<ID>"
    },
    {
      "id": "<ID>"
    }
  ],
  ....
}

So fügst du selbstdefinierte Conversions hinzu:

curl -i -X POST \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_custom_conversions?asset_id=<ID>&access_token=<TOKEN>"

So entfernst du selbstdefinierte Conversions:

curl -i -X DELETE \
 "https://graph.facebook.com/<VERSION>/<BUS_ASSET_GROUP_ID>/contained_custom_conversions?asset_id=<ID>&access_token=<TOKEN>"

Wenn du entweder eine selbstdefinierte Conversion erfolgreich hinzufügst oder entfernst, wird true zurückgegeben.