Get call flow draft
curl --request GET \
--url https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft \
--header 'Authorization: <api-key>'import requests
url = "https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft', 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/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
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
}
}Numéros de téléphone
Récupérer le brouillon du flux d'appel
Returns the working draft of a phone number’s call flow. Unlike GET /v2/api/numbers/{number}/call_flow?status=draft, this endpoint does NOT fall back to the published flow when no draft exists — it returns 404 CALL_FLOW_DRAFT_NOT_FOUND. Use it to read a draft’s lock_version without risk of accidentally holding the published version’s lock.
GET
/
v2
/
api
/
numbers
/
{number}
/
call_flow
/
draft
Get call flow draft
curl --request GET \
--url https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft \
--header 'Authorization: <api-key>'import requests
url = "https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft', 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/draft",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/numbers/{number}/call_flow/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
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
}
}Scope requis :
PHONE_NUMBERS_READComportement
Renvoie le brouillon de travail du flux d’appel d’un numéro. Le paramètre de chemin{number} est le numéro Allo au format E.164 (ex. +14155551234).
Contrairement à Récupérer le flux d’appel avec ?status=draft, cette route ne bascule pas sur le flux publié (ni sur la synthèse de l’IVR héritée) lorsqu’aucun brouillon n’existe — elle renvoie 404 CALL_FLOW_DRAFT_NOT_FOUND.
La réponse contient une confirmation_url — le lien où un utilisateur connecté vérifie et publie ce brouillon. Pour le publier directement, appelez Publier le flux d’appel avec la lock_version de cette réponse.
Préférez cette route au début d’un cycle d’édition.
GET …/call_flow?status=draft renvoie 200 avec la version publiée lorsqu’il n’y a pas de brouillon, si bien qu’un client peut se retrouver avec le lock_version de la version publiée — ce qui échoue ensuite à POST …/call_flow/publish avec CALL_FLOW_STALE_LOCK. Cette route transforme « aucun brouillon » en un 404 explicite.Erreurs
404 CALL_FLOW_DRAFT_NOT_FOUND— le numéro n’a aucun brouillon de travail. Créez-en un 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. Listez-les avecGET /v2/api/numbers.
Cette page vous a-t-elle été utile ?