/api/v4/social/brandsCrea un brand
Crea un brand social che contiene gli account social collegati e i relativi post pubblicati. I brand sono illimitati nei piani API.
Parametri
Corpo
| Nome | Tipo | Obbligatorio | Descrizione |
|---|---|---|---|
| input | object | obbligatorio | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.profileName | string | obbligatorio | Display name of the brand. Shown wherever the brand is listed and used as the default author name in the composer. |
| input.timezone | object | obbligatorio | 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 | facoltativo | One or two sentences describing what the business does, used to tailor content suggestions. Defaults to `general` when omitted. |
| input.categories | array of strings | facoltativo | Business categories for the brand, e.g. `["Furniture Store"]`. Defaults to an empty list. |
| input.siteUrl | string | facoltativo | The brand's website. Used to enrich content suggestions; setting it also queues a one-off read of the site. |
| input.logo | string | facoltativo | Public https URL of the brand logo. |
| input.countryIso | string | facoltativo | Two-letter ISO country code for the brand, e.g. `US`. |
| input.bio | string | facoltativo | Short brand bio. |
| input.brandHashtags | array of strings | facoltativo | Hashtags that belong to the brand, offered as suggestions in the composer. |
| input.competitorHashtags | array of strings | facoltativo | Competitor hashtags to track alongside the brand's own. |
| input.contentPreferredLanguage | string | facoltativo | Preferred language for generated content, e.g. `en`. |
Richiesta di esempio
Corpo pronto da incollare. Sostituisci gli ID e i valori segnaposto con i tuoi.
{ "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"] }}Risposte
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.
Crea un brand: l'oggetto di primo livello della Social API. A un brand appartengono gli account social che vi colleghi e ogni post pubblicato da questi account. Non puoi effettuare altre chiamate alla Social API finché non esiste almeno un brand, quindi questa è la prima richiesta di qualsiasi integrazione Social.
Caso d'uso: configurare la pubblicazione sui social per un cliente. Quando un cliente si registra nel tuo prodotto, crea un brand per ogni attività per cui vuole pubblicare. Memorizza il valore socialProfile.id restituito nel tuo record di quell'attività: è il token di percorso brandId in POST /social/brands/{brandId}/connections/link e GET /social/brands/{brandId}/posts, e il campo socialProfileId nel corpo di ogni post che crei. Poi indirizza l'utente al link di collegamento ospitato per ogni piattaforma su cui vuole pubblicare.
Note.
- Il corpo della richiesta deve essere racchiuso in un oggetto
input. Ogni operazione di scrittura nella Social API usa questa struttura, con una sola eccezione: il link di collegamento accetta un corpo senza oggetto contenitore. - Controlla
success, non lo stato HTTP. Un errore di validazione — un valoreprofileNamemancante o un valoretimezone.tzCodesconosciuto — restituisceHTTP 200consuccess: falsee il motivo inerror. Considera la chiamata riuscita solo quandosuccessètrue. - Solo
profileNameetimezonesono obbligatori.businessIntentecategorieshanno come valori predefiniti rispettivamentegenerale un elenco vuoto, quindi un'integrazione che non ha un equivalente di questi campi può ometterli del tutto. timezone.tzCodenon è un elemento decorativo. Un post programmato conscheduleDate+scheduleTimeviene interpretato nel fuso orario del brand, non in quello di chi effettua la chiamata né in UTC. Modificarlo in seguito non cambia l'orario dei post già programmati.- Il brand appartiene sempre all'account associato alla chiave API. Non è possibile creare un brand in un altro account: qualsiasi identificatore di account presente nel corpo viene ignorato.
- Gli ID dei brand sono semplici UUID. Non sono gli ID relay in Base64 usati da Locations e dai Posts delle sedi, quindi non codificarli né decodificarli. Lo stesso ID compare come token di percorso
brandIde come camposocialProfileIdnel corpo:brandIdè sempre e solo un token dell'URL, mai un campo del corpo. - Un piano API non prevede alcun limite al numero di brand. I brand sono illimitati e non vengono conteggiati ai fini dell'utilizzo, quindi questa chiamata non viene mai rifiutata per il raggiungimento di un limite e non devi verificare la capacità residua prima di crearne uno. A essere conteggiati sono i collegamenti — un account social collegato a un brand su una rete. Consulta Piani e componenti aggiuntivi per le fasce di collegamenti e il prezzo di un pacchetto di collegamenti, e
GET /social/limitsper verificare quanti collegamenti puoi ancora creare prima di indirizzare un utente a un link di collegamento.
Operazione di scrittura: non eseguita sull'account reale. La richiesta e la risposta mostrate sono costruite a partire dallo schema API.
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" ] } }'