POST/api/v4/social/brands

Marka oluşturma

Bağlı sosyal hesapları ve bu hesaplardan yayımlanan gönderileri içeren bir sosyal marka oluşturur. API planlarında marka sayısı sınırsızdır.

API anahtarı gerektirir. Başlık biçimi ve anahtar yenileme için Kimlik doğrulama bölümüne bakın.

Parametreler

Gövde

AdTürZorunluAçıklama
inputobjectzorunluWrapper object. Every field below is a property of `input`, the entire body must be nested under it.
input.profileNamestringzorunluDisplay name of the brand. Shown wherever the brand is listed and used as the default author name in the composer.
input.timezoneobjectzorunluThe brand's timezone as `{ label, tzCode, name, utc }`, all strings. `tzCode` is the one that matters: it is the IANA identifier the API validates and uses to interpret every `scheduleDate` / `scheduleTime` on this brand's posts. The other three are display labels.
input.businessIntentstringisteğe bağlıOne or two sentences describing what the business does, used to tailor content suggestions. Defaults to `general` when omitted.
input.categoriesarray of stringsisteğe bağlıBusiness categories for the brand, e.g. `["Furniture Store"]`. Defaults to an empty list.
input.siteUrlstringisteğe bağlıThe brand's website. Used to enrich content suggestions; setting it also queues a one-off read of the site.
input.logostringisteğe bağlıPublic https URL of the brand logo.
input.countryIsostringisteğe bağlıTwo-letter ISO country code for the brand, e.g. `US`.
input.biostringisteğe bağlıShort brand bio.
input.brandHashtagsarray of stringsisteğe bağlıHashtags that belong to the brand, offered as suggestions in the composer.
input.competitorHashtagsarray of stringsisteğe bağlıCompetitor hashtags to track alongside the brand's own.
input.contentPreferredLanguagestringisteğe bağlıPreferred language for generated content, e.g. `en`.

Örnek istek

Yapıştırmaya hazır gövde. Yer tutucu kimlikleri ve değerleri kendi değerlerinizle değiştirin.

Request body
{  "input": {    "profileName": "Jenny Home",    "timezone": {      "label": "(GMT-05:00) Eastern Time",      "tzCode": "America/New_York",      "name": "Eastern Standard Time",      "utc": "-05:00"    },    "businessIntent": "A family-run home furnishings store selling handmade furniture and textiles.",    "categories": ["Furniture Store", "Home Goods"],    "siteUrl": "https://jennyhome.example",    "countryIso": "US",    "bio": "Handmade furniture for real homes.",    "brandHashtags": ["jennyhome", "handmadefurniture"]  }}

Yanıtlar

200Brand created. `socialProfile.id` is the `brandId` every other Social endpoint takes.
Response
{  "data": {    "createSocialProfile": {      "success": true,      "error": null,      "socialProfile": {        "id": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902",        "profileName": "Jenny Home",        "archived": false,        "logo": null,        "profileLogo": null,        "siteUrl": "https://jennyhome.example",        "countryIso": "US",        "bio": "Handmade furniture for real homes.",        "businessIntent": "A family-run home furnishings store selling handmade furniture and textiles.",        "categories": ["Furniture Store", "Home Goods"],        "brandHashtags": ["jennyhome", "handmadefurniture"],        "competitorHashtags": [],        "connectedChannelCount": 0,        "timezone": {          "label": "(GMT-05:00) Eastern Time",          "tzCode": "America/New_York",          "name": "Eastern Standard Time",          "utc": "-05:00"        },        "contentPreferredLanguage": "en"      }    }  }}
200Validation failed. The status is still 200: read `success`.
Response
{  "data": {    "createSocialProfile": {      "success": false,      "error": {        "message": "SY90003: timezone.tzCode is not a valid IANA identifier",        "code": "SY90003",        "contextInfo": null      },      "socialProfile": null    }  }}
401Unauthenticated, missing or invalid API key.

Social API'deki en üst düzey nesne olan bir marka oluşturur. Bir marka, kendisine bağladığınız sosyal hesapların ve bu hesaplardan yayımlanan her gönderinin sahibidir. En az bir marka oluşturulana kadar Social API'de başka hiçbir çağrı yapılamaz; bu nedenle bu, her Social entegrasyonundaki ilk istektir.

Kullanım senaryosu: bir müşteriyi sosyal platformlarda yayın yapmaya hazırlama. Bir müşteri ürününüze kaydolduğunda, adına yayın yapmak istediği her işletme için bir marka oluşturun. Döndürülen socialProfile.id değerini, ilgili işletmeye ait kendi kaydınızla ilişkilendirerek saklayın: bu değer, POST /social/brands/{brandId}/connections/link ve GET /social/brands/{brandId}/posts içindeki brandId yol belirtecidir ve oluşturduğunuz her gönderideki socialProfileId gövde alanıdır. Ardından kullanıcıyı, yayın yapmak istediği her platform için barındırılan bağlantı oluşturma bağlantısına yönlendirin.

Notlar.

  • İstek gövdesi bir input nesnesi içine alınmalıdır. Social API'deki her yazma işleminde bu yapı kullanılır; tek istisna, düz bir gövde alan bağlantı oluşturma bağlantısıdır.
  • HTTP durumunu değil, success değerini kontrol edin. Eksik bir profileName veya bilinmeyen bir timezone.tzCode nedeniyle oluşan doğrulama hatası, success: false ile birlikte HTTP 200 olarak döner ve hata nedeni error içinde yer alır. Çağrıyı yalnızca success değeri true olduğunda başarılı kabul edin.
  • Yalnızca profileName ve timezone zorunludur. businessIntent ve categories için varsayılan değerler sırasıyla general ve boş bir listedir; dolayısıyla bu alanların karşılığı bulunmayan bir entegrasyon, bunları tamamen dışarıda bırakabilir.
  • timezone.tzCode yalnızca görünüm amaçlı değildir. scheduleDate + scheduleTime ile zamanlanan bir gönderi, çağrıyı yapanın saat diliminde veya UTC'de değil, markanın saat diliminde yorumlanır. Bu değeri daha sonra değiştirmek, önceden zamanlanmış gönderilerin zamanını değiştirmez.
  • Marka her zaman API anahtarının ait olduğu hesaba aittir. Başka bir hesapta marka oluşturmanın bir yolu yoktur: gövdedeki herhangi bir hesap tanımlayıcısı yok sayılır.
  • Marka kimlikleri düz UUID değerleridir. Bunlar, Locations ve konum Posts için kullanılan Base64 relay kimlikleri değildir; bu nedenle bunları kodlamayın veya kodlarını çözmeyin. Aynı kimlik hem brandId yol belirteci hem de socialProfileId gövde alanı olarak görünür: brandId her zaman yalnızca bir URL belirtecidir, hiçbir zaman gövde alanı değildir.
  • API planında marka sınırı yoktur. Markalar sınırsızdır ve kullanımları ölçülmez; bu nedenle bu çağrı hiçbir zaman bir üst sınır nedeniyle reddedilmez ve marka oluşturmadan önce kalan kapasiteyi kontrol etmeniz gerekmez. Kullanımı ölçülen birim bağlantılardır; her bağlantı, bir ağda bir markaya bağlanan bir sosyal hesaptır. Bağlantı kademeleri ve bağlantı paketi fiyatı için Planlar ve eklentiler sayfasına, bir kullanıcıyı bağlantı oluşturma bağlantısına yönlendirmeden önce kalan bağlantı kapasitenizi öğrenmek için GET /social/limits bölümüne bakın.

Yazma işlemi: canlı hesap üzerinde yürütülmemiştir. Gösterilen istek ve yanıt, API şemasından oluşturulmuştur.

Request
curl -X POST 'https://listingsapi.com/api/v4/social/brands' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "input": {      "profileName": "Jenny Home",      "timezone": {        "label": "(GMT-05:00) Eastern Time",        "tzCode": "America/New_York",        "name": "Eastern Standard Time",        "utc": "-05:00"      },      "businessIntent": "A family-run home furnishings store selling handmade furniture and textiles.",      "categories": [        "Furniture Store",        "Home Goods"      ],      "siteUrl": "https://jennyhome.example",      "countryIso": "US",      "bio": "Handmade furniture for real homes.",      "brandHashtags": [        "jennyhome",        "handmadefurniture"      ]    }  }'