/api/v4/social/brandsMarka 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.
Parametreler
Gövde
| Ad | Tür | Zorunlu | Açıklama |
|---|---|---|---|
| input | object | zorunlu | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.profileName | string | zorunlu | Display name of the brand. Shown wherever the brand is listed and used as the default author name in the composer. |
| input.timezone | object | zorunlu | The 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.businessIntent | string | isteğe bağlı | One or two sentences describing what the business does, used to tailor content suggestions. Defaults to `general` when omitted. |
| input.categories | array of strings | isteğe bağlı | Business categories for the brand, e.g. `["Furniture Store"]`. Defaults to an empty list. |
| input.siteUrl | string | isteğe bağlı | The brand's website. Used to enrich content suggestions; setting it also queues a one-off read of the site. |
| input.logo | string | isteğe bağlı | Public https URL of the brand logo. |
| input.countryIso | string | isteğe bağlı | Two-letter ISO country code for the brand, e.g. `US`. |
| input.bio | string | isteğe bağlı | Short brand bio. |
| input.brandHashtags | array of strings | isteğe bağlı | Hashtags that belong to the brand, offered as suggestions in the composer. |
| input.competitorHashtags | array of strings | isteğe bağlı | Competitor hashtags to track alongside the brand's own. |
| input.contentPreferredLanguage | string | isteğ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.
{ "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.
{ "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`.
{ "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
inputnesnesi 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,
successdeğerini kontrol edin. Eksik birprofileNameveya bilinmeyen birtimezone.tzCodenedeniyle oluşan doğrulama hatası,success: falseile birlikteHTTP 200olarak döner ve hata nedenierroriçinde yer alır. Çağrıyı yalnızcasuccessdeğeritrueolduğunda başarılı kabul edin. - Yalnızca
profileNamevetimezonezorunludur.businessIntentvecategoriesiçin varsayılan değerler sırasıylageneralve boş bir listedir; dolayısıyla bu alanların karşılığı bulunmayan bir entegrasyon, bunları tamamen dışarıda bırakabilir. timezone.tzCodeyalnızca görünüm amaçlı değildir.scheduleDate+scheduleTimeile 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
brandIdyol belirteci hem desocialProfileIdgövde alanı olarak görünür:brandIdher 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/limitsbö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.
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" ] } }'