Criar fluxo IVR (rascunho)
curl --request POST \
--url https://api.notifique.dev/v1/voice/flows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Menu principal",
"graph": {
"entry": "menu",
"nodes": [
{
"id": "menu",
"type": "gather",
"prompt": "Pressione 1 para vendas.",
"maxDigits": 1,
"timeoutSecs": 10,
"branches": {
"1": "vendas"
},
"default": "fim"
},
{
"id": "vendas",
"type": "speak",
"text": "Obrigado.",
"next": "fim"
},
{
"id": "fim",
"type": "hangup"
}
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Menu principal',
graph: {
entry: 'menu',
nodes: [
{
id: 'menu',
type: 'gather',
prompt: 'Pressione 1 para vendas.',
maxDigits: 1,
timeoutSecs: 10,
branches: {'1': 'vendas'},
default: 'fim'
},
{id: 'vendas', type: 'speak', text: 'Obrigado.', next: 'fim'},
{id: 'fim', type: 'hangup'}
]
}
})
};
fetch('https://api.notifique.dev/v1/voice/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/voice/flows"
payload = {
"name": "Menu principal",
"graph": {
"entry": "menu",
"nodes": [
{
"id": "menu",
"type": "gather",
"prompt": "Pressione 1 para vendas.",
"maxDigits": 1,
"timeoutSecs": 10,
"branches": { "1": "vendas" },
"default": "fim"
},
{
"id": "vendas",
"type": "speak",
"text": "Obrigado.",
"next": "fim"
},
{
"id": "fim",
"type": "hangup"
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notifique.dev/v1/voice/flows"
payload := strings.NewReader("{\n \"name\": \"Menu principal\",\n \"graph\": {\n \"entry\": \"menu\",\n \"nodes\": [\n {\n \"id\": \"menu\",\n \"type\": \"gather\",\n \"prompt\": \"Pressione 1 para vendas.\",\n \"maxDigits\": 1,\n \"timeoutSecs\": 10,\n \"branches\": {\n \"1\": \"vendas\"\n },\n \"default\": \"fim\"\n },\n {\n \"id\": \"vendas\",\n \"type\": \"speak\",\n \"text\": \"Obrigado.\",\n \"next\": \"fim\"\n },\n {\n \"id\": \"fim\",\n \"type\": \"hangup\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Voice: Fluxos IVR
Criar fluxo IVR (rascunho)
POST
/
v1
/
voice
/
flows
Criar fluxo IVR (rascunho)
curl --request POST \
--url https://api.notifique.dev/v1/voice/flows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Menu principal",
"graph": {
"entry": "menu",
"nodes": [
{
"id": "menu",
"type": "gather",
"prompt": "Pressione 1 para vendas.",
"maxDigits": 1,
"timeoutSecs": 10,
"branches": {
"1": "vendas"
},
"default": "fim"
},
{
"id": "vendas",
"type": "speak",
"text": "Obrigado.",
"next": "fim"
},
{
"id": "fim",
"type": "hangup"
}
]
}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Menu principal',
graph: {
entry: 'menu',
nodes: [
{
id: 'menu',
type: 'gather',
prompt: 'Pressione 1 para vendas.',
maxDigits: 1,
timeoutSecs: 10,
branches: {'1': 'vendas'},
default: 'fim'
},
{id: 'vendas', type: 'speak', text: 'Obrigado.', next: 'fim'},
{id: 'fim', type: 'hangup'}
]
}
})
};
fetch('https://api.notifique.dev/v1/voice/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/voice/flows"
payload = {
"name": "Menu principal",
"graph": {
"entry": "menu",
"nodes": [
{
"id": "menu",
"type": "gather",
"prompt": "Pressione 1 para vendas.",
"maxDigits": 1,
"timeoutSecs": 10,
"branches": { "1": "vendas" },
"default": "fim"
},
{
"id": "vendas",
"type": "speak",
"text": "Obrigado.",
"next": "fim"
},
{
"id": "fim",
"type": "hangup"
}
]
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notifique.dev/v1/voice/flows"
payload := strings.NewReader("{\n \"name\": \"Menu principal\",\n \"graph\": {\n \"entry\": \"menu\",\n \"nodes\": [\n {\n \"id\": \"menu\",\n \"type\": \"gather\",\n \"prompt\": \"Pressione 1 para vendas.\",\n \"maxDigits\": 1,\n \"timeoutSecs\": 10,\n \"branches\": {\n \"1\": \"vendas\"\n },\n \"default\": \"fim\"\n },\n {\n \"id\": \"vendas\",\n \"type\": \"speak\",\n \"text\": \"Obrigado.\",\n \"next\": \"fim\"\n },\n {\n \"id\": \"fim\",\n \"type\": \"hangup\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Esta página foi útil?

