Importe
Basis-URL: https://app.neuroflash.com/api/brand-voice-service
Generieren Sie Markenstimmprofile automatisch aus Text, URLs oder hochgeladenen Dateien.
Die Import-Endpoints analysieren Ihr Quellmaterial und geben ein vorgeschlagenes Brand-Voice-Profil zurück.
Es wird nichts in Ihrem Workspace gespeichert. Die Antwort enthält keine id und kann
später nicht abgerufen werden.
Um das Ergebnis zu speichern, übergeben Sie die extrahierten Attribute an
POST /brand-voices in einem Folgeaufruf.
Siehe den Brand-Voice-Pipeline-Leitfaden für den vollständigen Workflow.
Erstellt einen Dateiimport, der den Inhalt in eine Markenstimme konvertiert
/v1/workspaces/{workspaceId}/brand-voice-file-importsPfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workspaceId | string | Ja | Arbeitsbereich-ID (uuid4) |
Anfrage-Body
audienceModelIdstringJacountrystringJafileContentstringJafilenamestringJalanguagestringJamimeTypestringJaAntwort
brandobject
addressstringemailstringfacebookLinkstringinstagramLinkstringlinkedinLinkstringnamestringphonesarray<string>valuesarray<string>websitestringbrandVoiceobject
abbreviationRulesstringactivebooleanactiveVoicebooleanadvancedRulesarray<string>brandobject
addressstringemailstringfacebookLinkstringinstagramLinkstringlinkedinLinkstringnamestringphonesarray<string>valuesarray<string>websitestringcontentExamplesarray<object>
contentstringsourcestringurlstringcountrystringcreationSourceDocumentIDstringcreationSourceTextstringcreationSourceTypestringcreationSourceURLstringcurrencyFormatstringdateFormatstringdescriptionstringdontsstringemojiUsagestringgenderingstringgeneralToneobjectglossariesarray<object>
extendedstringshortcutstringheadlinePunctuationarray<string>hyphenationRulesarray<string>industryJargonstringlanguagestringnamestringnumberFormatstringpersonalbooleanperspectivearray<string>phoneNumberFormatstringthumbnailBase64stringBase64-codiertes BildtimeFormatstringuseControversialEmojisbooleanuseHeaderPunctuationbooleanuseHyphensbooleanvocabularyarray<string>Beispiel
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/{workspace_id}/brand-voice-file-imports" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"audienceModelId": "string",
"country": "string",
"fileContent": "string",
"filename": "string",
"language": "string",
"mimeType": "string"
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/{workspace_id}/brand-voice-file-imports",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"audienceModelId": "string",
"country": "string",
"fileContent": "string",
"filename": "string",
"language": "string",
"mimeType": "string"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/${workspaceId}/brand-voice-file-imports`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"audienceModelId": "string",
"country": "string",
"fileContent": "string",
"filename": "string",
"language": "string",
"mimeType": "string"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"audienceModelId": "string",
"country": "string",
"fileContent": "string",
"filename": "string",
"language": "string",
"mimeType": "string",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/"+workspaceID+"/brand-voice-file-imports", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Hinweis: Diese Antwort ist ein Entwurf. Es wurde noch keine Brand Voice erstellt. Verwenden Sie die
brandVoice-Felder als Eingabe fürPOST /brand-voices, um sie zu speichern.
Antwort:
{
"brand": {
"address": "Germany, Berlin, ...",
"email": "test@neuroflash.com",
"facebookLink": "https://facebook.com/test",
"instagramLink": "https://instagram.com/test",
"linkedinLink": "https://linkedin.com/test",
"name": "neuroflash",
"phones": [
"+00000000",
"+11111111"
],
"values": [
"proactivity",
"stability"
],
"website": "https://test.com"
},
"brandVoice": {
"abbreviationRules": "use_freely",
"active": false,
"activeVoice": false,
"advancedRules": [
"string"
],
"brand": {
"address": "Germany, Berlin, ...",
"email": "test@neuroflash.com",
"facebookLink": "https://facebook.com/test",
"instagramLink": "https://instagram.com/test",
"linkedinLink": "https://linkedin.com/test",
"name": "neuroflash",
"phones": [
"+00000000",
"+11111111"
],
"values": [
"proactivity",
"stability"
],
"website": "https://test.com"
},
"contentExamples": [
{
"content": "instagram post content",
"source": "instagram",
"url": "https://instagram.com/test"
}
],
"country": "us",
"creationSourceDocumentID": "string",
"creationSourceText": "very interesting text that was used to import this brand voice",
"creationSourceType": "manual",
"creationSourceURL": "https://test.com",
"currencyFormat": "number_space_symbol",
"dateFormat": "EN",
"description": "Description of Brand Voice",
"donts": "string",
"emojiUsage": "no_emojis",
"gendering": "gender_neutral",
"generalTone": {},
"glossaries": [
{
"extended": "For your information",
"shortcut": "FYI"
}
],
"headlinePunctuation": [
"title_case"
],
"hyphenationRules": [
"allow_hyphenation_brand_name"
],
"industryJargon": "no_jargon",
"language": "en",
"name": "My Brand Voice",
"numberFormat": "EN",
"personal": false,
"perspective": [
"first_person_singular"
],
"phoneNumberFormat": "international_e164",
"thumbnailBase64": "string",
"timeFormat": "24h",
"useControversialEmojis": false,
"useHeaderPunctuation": false,
"useHyphens": false,
"vocabulary": [
"ChatFlash",
"image generation"
]
}
}
Erstellt einen Textimport, der ihn in eine Markenstimme konvertiert
/v1/workspaces/{workspaceId}/brand-voice-text-importsPfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workspaceId | string | Ja | Arbeitsbereich-ID (uuid4) |
Anfrage-Body
audienceModelIdstringJacountrystringJalanguagestringJatextstringJaAntwort
brandobject
addressstringemailstringfacebookLinkstringinstagramLinkstringlinkedinLinkstringnamestringphonesarray<string>valuesarray<string>websitestringbrandVoiceobject
abbreviationRulesstringactivebooleanactiveVoicebooleanadvancedRulesarray<string>brandobject
addressstringemailstringfacebookLinkstringinstagramLinkstringlinkedinLinkstringnamestringphonesarray<string>valuesarray<string>websitestringcontentExamplesarray<object>
contentstringsourcestringurlstringcountrystringcreationSourceDocumentIDstringcreationSourceTextstringcreationSourceTypestringcreationSourceURLstringcurrencyFormatstringdateFormatstringdescriptionstringdontsstringemojiUsagestringgenderingstringgeneralToneobjectglossariesarray<object>
extendedstringshortcutstringheadlinePunctuationarray<string>hyphenationRulesarray<string>industryJargonstringlanguagestringnamestringnumberFormatstringpersonalbooleanperspectivearray<string>phoneNumberFormatstringthumbnailBase64stringBase64-codiertes BildtimeFormatstringuseControversialEmojisbooleanuseHeaderPunctuationbooleanuseHyphensbooleanvocabularyarray<string>Beispiel
Der Brand-Voice-Import umfasst eine KI-Analyse und kann 10–30 Sekunden dauern. Planen Sie Ihre Integration entsprechend und ziehen Sie Polling- oder Retry-Logik in Betracht, wenn Sie das Ergebnis sofort benötigen.
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/{workspace_id}/brand-voice-text-imports" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "us",
"language": "en",
"text": "neuroflash is Europe's leading AI content platform, helping marketing teams create on-brand content faster with a clear, confident, and human voice."
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/{workspace_id}/brand-voice-text-imports",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "us",
"language": "en",
"text": "neuroflash is Europe's leading AI content platform, helping marketing teams create on-brand content faster with a clear, confident, and human voice."
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/${workspaceId}/brand-voice-text-imports`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "us",
"language": "en",
"text": "neuroflash is Europe's leading AI content platform, helping marketing teams create on-brand content faster with a clear, confident, and human voice."
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "us",
"language": "en",
"text": "neuroflash is Europe's leading AI content platform, helping marketing teams create on-brand content faster with a clear, confident, and human voice.",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/"+workspaceID+"/brand-voice-text-imports", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Hinweis: Diese Antwort ist ein Entwurf. Es wurde noch keine Brand Voice erstellt. Verwenden Sie die
brandVoice-Felder als Eingabe fürPOST /brand-voices, um sie zu speichern.
Antwort:
{
"brand": {
"address": "Germany, Berlin, ...",
"email": "test@neuroflash.com",
"facebookLink": "https://facebook.com/test",
"instagramLink": "https://instagram.com/test",
"linkedinLink": "https://linkedin.com/test",
"name": "neuroflash",
"phones": [
"+00000000",
"+11111111"
],
"values": [
"proactivity",
"stability"
],
"website": "https://test.com"
},
"brandVoice": {
"abbreviationRules": "use_freely",
"active": false,
"activeVoice": false,
"advancedRules": [
"string"
],
"brand": {
"address": "Germany, Berlin, ...",
"email": "test@neuroflash.com",
"facebookLink": "https://facebook.com/test",
"instagramLink": "https://instagram.com/test",
"linkedinLink": "https://linkedin.com/test",
"name": "neuroflash",
"phones": [
"+00000000",
"+11111111"
],
"values": [
"proactivity",
"stability"
],
"website": "https://test.com"
},
"contentExamples": [
{
"content": "instagram post content",
"source": "instagram",
"url": "https://instagram.com/test"
}
],
"country": "us",
"creationSourceDocumentID": "string",
"creationSourceText": "very interesting text that was used to import this brand voice",
"creationSourceType": "manual",
"creationSourceURL": "https://test.com",
"currencyFormat": "number_space_symbol",
"dateFormat": "EN",
"description": "Description of Brand Voice",
"donts": "string",
"emojiUsage": "no_emojis",
"gendering": "gender_neutral",
"generalTone": {},
"glossaries": [
{
"extended": "For your information",
"shortcut": "FYI"
}
],
"headlinePunctuation": [
"title_case"
],
"hyphenationRules": [
"allow_hyphenation_brand_name"
],
"industryJargon": "no_jargon",
"language": "en",
"name": "My Brand Voice",
"numberFormat": "EN",
"personal": false,
"perspective": [
"first_person_singular"
],
"phoneNumberFormat": "international_e164",
"thumbnailBase64": "string",
"timeFormat": "24h",
"useControversialEmojis": false,
"useHeaderPunctuation": false,
"useHyphens": false,
"vocabulary": [
"ChatFlash",
"image generation"
]
}
}
Erstellt einen URL-Import, der den Inhalt der angegebenen Seite analysiert und in eine Markenstimme konvertiert
/v1/workspaces/{workspaceId}/brand-voice-url-importsPfadparameter
| Parameter | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
workspaceId | string | Ja | Arbeitsbereich-ID (uuid4) |
Anfrage-Body
audienceModelIdstringJacountrystringJalanguagestringJaurlstringJaAntwort
brandobject
addressstringemailstringfacebookLinkstringinstagramLinkstringlinkedinLinkstringnamestringphonesarray<string>valuesarray<string>websitestringbrandVoiceobject
abbreviationRulesstringactivebooleanactiveVoicebooleanadvancedRulesarray<string>brandobject
addressstringemailstringfacebookLinkstringinstagramLinkstringlinkedinLinkstringnamestringphonesarray<string>valuesarray<string>websitestringcontentExamplesarray<object>
contentstringsourcestringurlstringcountrystringcreationSourceDocumentIDstringcreationSourceTextstringcreationSourceTypestringcreationSourceURLstringcurrencyFormatstringdateFormatstringdescriptionstringdontsstringemojiUsagestringgenderingstringgeneralToneobjectglossariesarray<object>
extendedstringshortcutstringheadlinePunctuationarray<string>hyphenationRulesarray<string>industryJargonstringlanguagestringnamestringnumberFormatstringpersonalbooleanperspectivearray<string>phoneNumberFormatstringthumbnailBase64stringBase64-codiertes BildtimeFormatstringuseControversialEmojisbooleanuseHeaderPunctuationbooleanuseHyphensbooleanvocabularyarray<string>Beispiel
Der Brand-Voice-Import umfasst eine KI-Analyse und kann 10–30 Sekunden dauern. Planen Sie Ihre Integration entsprechend und ziehen Sie Polling- oder Retry-Logik in Betracht, wenn Sie das Ergebnis sofort benötigen.
- cURL
- Python
- Node.js
- Go
curl -X POST "https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/{workspace_id}/brand-voice-url-imports" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "string",
"language": "string",
"url": "https://your-brand.com"
}'
import requests
response = requests.post(
f"https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/{workspace_id}/brand-voice-url-imports",
headers={"Authorization": f"Bearer {token}", "Content-Type": "application/json"},
json={
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "string",
"language": "string",
"url": "https://your-brand.com"
},
).json()
const response = await fetch(
`https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/${workspaceId}/brand-voice-url-imports`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "string",
"language": "string",
"url": "https://your-brand.com"
}),
}
).then((r) => r.json());
body, _ := json.Marshal(map[string]any{
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "string",
"language": "string",
"url": "https://your-brand.com",
})
req, _ := http.NewRequest("POST", "https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/"+workspaceID+"/brand-voice-url-imports", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
Hinweis: Diese Antwort ist ein Entwurf. Es wurde noch keine Brand Voice erstellt. Verwenden Sie die
brandVoice-Felder als Eingabe fürPOST /brand-voices, um sie zu speichern.
Antwort:
{
"brand": {
"address": "Germany, Berlin, ...",
"email": "test@neuroflash.com",
"facebookLink": "https://facebook.com/test",
"instagramLink": "https://instagram.com/test",
"linkedinLink": "https://linkedin.com/test",
"name": "neuroflash",
"phones": [
"+00000000",
"+11111111"
],
"values": [
"proactivity",
"stability"
],
"website": "https://test.com"
},
"brandVoice": {
"abbreviationRules": "use_freely",
"active": false,
"activeVoice": false,
"advancedRules": [
"string"
],
"brand": {
"address": "Germany, Berlin, ...",
"email": "test@neuroflash.com",
"facebookLink": "https://facebook.com/test",
"instagramLink": "https://instagram.com/test",
"linkedinLink": "https://linkedin.com/test",
"name": "neuroflash",
"phones": [
"+00000000",
"+11111111"
],
"values": [
"proactivity",
"stability"
],
"website": "https://test.com"
},
"contentExamples": [
{
"content": "instagram post content",
"source": "instagram",
"url": "https://instagram.com/test"
}
],
"country": "us",
"creationSourceDocumentID": "string",
"creationSourceText": "very interesting text that was used to import this brand voice",
"creationSourceType": "manual",
"creationSourceURL": "https://test.com",
"currencyFormat": "number_space_symbol",
"dateFormat": "EN",
"description": "Description of Brand Voice",
"donts": "string",
"emojiUsage": "no_emojis",
"gendering": "gender_neutral",
"generalTone": {},
"glossaries": [
{
"extended": "For your information",
"shortcut": "FYI"
}
],
"headlinePunctuation": [
"title_case"
],
"hyphenationRules": [
"allow_hyphenation_brand_name"
],
"industryJargon": "no_jargon",
"language": "en",
"name": "My Brand Voice",
"numberFormat": "EN",
"personal": false,
"perspective": [
"first_person_singular"
],
"phoneNumberFormat": "international_e164",
"thumbnailBase64": "string",
"timeFormat": "24h",
"useControversialEmojis": false,
"useHeaderPunctuation": false,
"useHyphens": false,
"vocabulary": [
"ChatFlash",
"image generation"
]
}
}
Import-Entwurf speichern
Import-Antworten werden nicht automatisch gespeichert. Verwenden Sie die extrahierten
brandVoice-Attribute, um eine Brand Voice in einem Folgeaufruf zu erstellen:
- cURL
- Python
- Node.js
- Go
# Step 1: Import from URL — get the draft
DRAFT=$(curl -s -X POST \
"https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/{workspace_id}/brand-voice-url-imports" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "us",
"language": "en",
"url": "https://your-brand.com"
}')
# Step 2: Create brand voice with extracted name and description
curl -X POST \
"https://app.neuroflash.com/api/brand-voice-service/v1/workspaces/{workspace_id}/brand-voices" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"name\": $(echo $DRAFT | jq '.brandVoice.name'),
\"description\": $(echo $DRAFT | jq '.brandVoice.description'),
\"language\": $(echo $DRAFT | jq '.brandVoice.language'),
\"country\": $(echo $DRAFT | jq '.brandVoice.country'),
\"creationSourceType\": \"url\",
\"creationSourceURL\": \"https://your-brand.com\",
\"brand\": { \"name\": $(echo $DRAFT | jq '.brand.name'), \"values\": [], \"phones\": [] }
}"
import requests
BASE_URL = "https://app.neuroflash.com/api/brand-voice-service"
headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
# Step 1: Import from URL — get the draft
draft = requests.post(
f"{BASE_URL}/v1/workspaces/{workspace_id}/brand-voice-url-imports",
headers=headers,
json={
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "us",
"language": "en",
"url": "https://your-brand.com",
},
).json()
bv = draft["brandVoice"]
brand = draft["brand"]
# Step 2: Create brand voice with extracted attributes — this saves to the workspace
saved = requests.post(
f"{BASE_URL}/v1/workspaces/{workspace_id}/brand-voices",
headers=headers,
json={
"name": bv["name"],
"description": bv.get("description"),
"language": bv.get("language"),
"country": bv.get("country"),
"generalTone": bv.get("generalTone"),
"vocabulary": bv.get("vocabulary"),
"glossaries": bv.get("glossaries"),
"advancedRules": bv.get("advancedRules"),
"emojiUsage": bv.get("emojiUsage"),
"gendering": bv.get("gendering"),
"industryJargon": bv.get("industryJargon"),
"abbreviationRules": bv.get("abbreviationRules"),
"perspective": bv.get("perspective"),
"headlinePunctuation": bv.get("headlinePunctuation"),
"creationSourceType": "url",
"creationSourceURL": "https://your-brand.com",
"brand": {
"name": brand.get("name", bv["name"]),
"values": brand.get("values", []),
"phones": brand.get("phones", []),
},
},
).json()
print(f"Saved brand voice ID: {saved['id']}")
const BASE_URL = "https://app.neuroflash.com/api/brand-voice-service";
const headers = { Authorization: `Bearer ${token}`, "Content-Type": "application/json" };
// Step 1: Import from URL — get the draft
const draft = await fetch(
`${BASE_URL}/v1/workspaces/${workspaceId}/brand-voice-url-imports`,
{
method: "POST",
headers,
body: JSON.stringify({
audienceModelId: "538b1efc6f88ad88feebf7acd8c618facb54fe82",
country: "us",
language: "en",
url: "https://your-brand.com",
}),
}
).then((r) => r.json());
const { brandVoice: bv, brand } = draft;
// Step 2: Create brand voice with extracted attributes
const saved = await fetch(
`${BASE_URL}/v1/workspaces/${workspaceId}/brand-voices`,
{
method: "POST",
headers,
body: JSON.stringify({
name: bv.name,
description: bv.description,
language: bv.language,
country: bv.country,
generalTone: bv.generalTone,
vocabulary: bv.vocabulary,
glossaries: bv.glossaries,
advancedRules: bv.advancedRules,
emojiUsage: bv.emojiUsage,
gendering: bv.gendering,
industryJargon: bv.industryJargon,
abbreviationRules: bv.abbreviationRules,
perspective: bv.perspective,
headlinePunctuation: bv.headlinePunctuation,
creationSourceType: "url",
creationSourceURL: "https://your-brand.com",
brand: { name: brand.name || bv.name, values: brand.values || [], phones: [] },
}),
}
).then((r) => r.json());
console.log("Saved brand voice ID:", saved.id);
// Step 1: Import from URL — get the draft
importBody, _ := json.Marshal(map[string]any{
"audienceModelId": "538b1efc6f88ad88feebf7acd8c618facb54fe82",
"country": "us", "language": "en",
"url": "https://your-brand.com",
})
req, _ := http.NewRequest("POST",
baseURL+"/brand-voice-service/v1/workspaces/"+workspaceID+"/brand-voice-url-imports",
bytes.NewReader(importBody))
req.Header.Set("Authorization", "Bearer "+token)
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var draft struct {
Brand map[string]any `json:"brand"`
BrandVoice map[string]any `json:"brandVoice"`
}
json.NewDecoder(resp.Body).Decode(&draft)
bv := draft.BrandVoice
// Step 2: Create brand voice with extracted attributes
createBody, _ := json.Marshal(map[string]any{
"name": bv["name"], "description": bv["description"],
"language": bv["language"], "country": bv["country"],
"generalTone": bv["generalTone"], "vocabulary": bv["vocabulary"],
"glossaries": bv["glossaries"], "advancedRules": bv["advancedRules"],
"emojiUsage": bv["emojiUsage"], "gendering": bv["gendering"],
"creationSourceType": "url", "creationSourceURL": "https://your-brand.com",
"brand": map[string]any{
"name": draft.Brand["name"], "values": []any{}, "phones": []any{},
},
})
req2, _ := http.NewRequest("POST",
baseURL+"/brand-voice-service/v1/workspaces/"+workspaceID+"/brand-voices",
bytes.NewReader(createBody))
req2.Header.Set("Authorization", "Bearer "+token)
req2.Header.Set("Content-Type", "application/json")
resp2, _ := http.DefaultClient.Do(req2)
defer resp2.Body.Close()
var saved map[string]any
json.NewDecoder(resp2.Body).Decode(&saved)
fmt.Printf("Saved brand voice ID: %s\n", saved["id"])