Publish call flow
curl --request POST \
--url https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"lock_version": 0
}
'import requests
url = "https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish"
payload = { "lock_version": 0 }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({lock_version: 0})
};
fetch('https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lock_version' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish"
payload := strings.NewReader("{\n \"lock_version\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lock_version\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lock_version\": 0\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cflv-abc123",
"flow_id": "cflw-abc123",
"version": 3,
"status": "PUBLISHED",
"lock_version": 0,
"schema_version": 1,
"engine_subset": "FULL_FLOW",
"number": "+14155551234",
"confirmation_url": "https://app.withallo.com/call-flow-draft/cflv-abc123",
"entry_node_id": "node-22",
"definition": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Numéros de téléphone
Publier le flux d'appel
Publishes the working draft, making it the live call flow for the phone number. This changes live inbound routing immediately. Runs full validation, which is stricter than the lenient validation a draft save runs, so a draft that saved successfully can still fail to publish; the whole publish rolls back if validation fails. Publishing consumes the draft, so the line is left with no draft afterwards.
POST
/
v2
/
api
/
numbers
/
{number}
/
call_flow
/
publish
Publish call flow
curl --request POST \
--url https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"lock_version": 0
}
'import requests
url = "https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish"
payload = { "lock_version": 0 }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({lock_version: 0})
};
fetch('https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'lock_version' => 0
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish"
payload := strings.NewReader("{\n \"lock_version\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}HttpResponse<String> response = Unirest.post("https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lock_version\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/numbers/{number}/call_flow/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lock_version\": 0\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "cflv-abc123",
"flow_id": "cflw-abc123",
"version": 3,
"status": "PUBLISHED",
"lock_version": 0,
"schema_version": 1,
"engine_subset": "FULL_FLOW",
"number": "+14155551234",
"confirmation_url": "https://app.withallo.com/call-flow-draft/cflv-abc123",
"entry_node_id": "node-22",
"definition": {}
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Scope requis :
PHONE_NUMBERS_WRITEComportement
Publie le brouillon de travail, ce qui en fait le flux d’appel en direct du numéro. Le paramètre de chemin{number} est le numéro Allo au format E.164.
Passez la lock_version du brouillon que vous publiez — récupérez-la avec Récupérer le brouillon du flux d’appel.
Cette route modifie immédiatement le routage des appels entrants en direct. Si vous préférez qu’une personne confirme la modification, n’appelez pas cette route : Enregistrer le brouillon du flux d’appel renvoie une
confirmation_url où un utilisateur connecté vérifie le brouillon et le publie lui-même.confirmation_url. Commencez le cycle d’édition suivant par un nouveau PUT …/call_flow/draft.
Erreurs
400 CALL_FLOW_INVALID— le brouillon a échoué à la validation complète.400 CALL_FLOW_ROOT_MENU_TOO_SMALL— le numéro utilise un SVI et ce flux laisserait son menu avec moins de 2 options.400 CALL_FLOW_CONTACT_PROPERTY_KEY_REQUIRED— un nœudCONTACT_PROPERTYn’a pas depropertyKey.400 CALL_FLOW_CONTACT_PROPERTY_VALUE_REQUIRED— un nœudCONTACT_PROPERTYn’a pas d’expectedValue.400 CALL_FLOW_CONTACT_PROPERTY_UNKNOWN— lapropertyKeyd’un nœudCONTACT_PROPERTYne correspond à aucune propriété de personne personnalisée de votre équipe. Renommer ou supprimer une propriété dans le CRM invalide un flux qui s’appuie dessus.404 CALL_FLOW_DRAFT_NOT_FOUND— il n’y a aucun brouillon à publier. Enregistrez-en un d’abord avecPUT /v2/api/numbers/{number}/call_flow/draft.404 PHONE_NUMBER_NOT_FOUND— le numéro ne fait pas partie des numéros de votre compte.409 CALL_FLOW_STALE_LOCK— lalock_versionest périmée ; récupérez à nouveau le brouillon et réessayez.
Autorisations
Paramètres de chemin
Allo phone number in E.164 format
Exemple:
"+14155551234"
Corps
application/json
The lock_version of the draft you are publishing.
Exemple:
0
Réponse
The published call flow
A version of a phone number's call flow.
Show child attributes
Show child attributes
Cette page vous a-t-elle été utile ?