VoiceBooker

Accesso API

VoiceBooker offre accesso programmatico all’API per integrare altre applicazioni e automatizzare i flussi, ad esempio il recupero dell’utilizzo, il deployment dei bot e l’integrazione di pipeline CI/CD.

URL di base

https://voicebooker.de/app/api/v1

Autenticazione

Inviare un token API in ogni richiesta usando uno dei seguenti header:

Authorization: Bearer <il-tuo-token-api>

oppure:

X-API-Token: <il-tuo-token-api>

Il token determina l’azienda associata alla richiesta. Conservarlo in modo sicuro.

Esportare un bot

GET /exportBots/{botId} esporta un bot dell’azienda associata al token API. Usare pretty=true per ottenere HJSON leggibile o nt=true per il formato testuale nidificato.

curl --get 'https://voicebooker.de/app/api/v1/exportBots/<bot-id>' \
  --header 'Authorization: Bearer <il-tuo-token-api>' \
  --data-urlencode 'pretty=true'

Esempio di risposta:

{
  "name": "Assistente reception",
  "id": "kqrmxaveli",
  "stages": [
    {
      "name": "Welcome",
      "id": "mavotirenu",
      "linkId": "qeluzanopi",
      "template": false,
      "prompt": "Saluta il chiamante.",
      "tools": [],
      "functions": [],
      "settings": {},
      "stageConfig": [],
      "x": 0,
      "y": 0,
      "order": 0,
      "instanceSettings": {}
    }
  ],
  "settings": {},
  "wizard": {}
}

Importare un bot

POST /importBots importa una definizione di bot nell’azienda associata al token. Inviare la definizione in contents. Per HJSON, filename deve terminare con .hjson. overwriteBotStages, overwriteTemplates e replaceBotStages sono parametri booleani opzionali.

curl --request POST \
  --url https://voicebooker.de/app/api/v1/importBots \
  --header 'Authorization: Bearer <il-tuo-token-api>' \
  --header 'Content-Type: application/json' \
  --data '{"filename":"bot.json","contents":{"name":"Assistente reception","settings":{},"stages":[]},"overwriteBotStages":false,"overwriteTemplates":false,"replaceBotStages":false}'

Esempio di risposta:

{
  "id": "vexorimaku",
  "name": "Assistente reception",
  "settings": {},
  "invisible": false
}

Effettuare chiamate in uscita

Per effettuare una chiamata in uscita, inviare una richiesta POST a:

https://voicebooker.de/app/api/v1/makeCall
Content-Type: application/json
Token: <il-tuo-token-api>

Esempio di richiesta:

{
  "dest": "+49-351-123456789",
  "botId": "kqrmxaveli",
  "sipAccountId": "lupenakori",
  "ringTimeout": 25,
  "startTimeout": 10,
  "state": {
    "customerId": "zpjwletodo"
  }
}
ParametroDescrizione
destNumero da chiamare in formato E.164.
botIdBot usato per la chiamata.
sipAccountIdAccount SIP usato; il suo numero viene mostrato al destinatario.
ringTimeoutSecondi di squillo prima dell’annullamento senza risposta. Predefinito: 30 secondi.
startTimeoutSecondi di attesa prima che il bot inizi a parlare.
stateDati utilizzabili da webhook o chiamate API durante la chiamata, ad esempio un ID cliente.

L’API restituisce un callId:

{
  "callId": "xavurimeto"
}

Recuperare l’utilizzo

GET /usage restituisce le sessioni telefoniche e chat dell’azienda autenticata e delle aziende partner disponibili.

Senza businessId vengono incluse tutte le aziende disponibili. Usare businessId per selezionare un’azienda e start e end per filtrare in base alla creazione della sessione.

curl --get https://voicebooker.de/app/api/v1/usage \
  --header 'X-API-Token: <il-tuo-token-api>' \
  --data-urlencode 'businessId=zpjwletodo' \
  --data-urlencode 'start=2026-01-01T00:00:00Z' \
  --data-urlencode 'end=2026-02-01T00:00:00Z'

start e end sono inclusivi. Usare date ISO 8601 valide. Un’azienda fuori dall’ambito del token restituisce 403 Forbidden.

Esempio di risposta:

[
  {
    "id": "xavurimeto", "businessId": "zpjwletodo", "botId": "kqrmxaveli",
    "isCall": true, "direction": "inbound", "phoneNumberCaller": "+391701234567",
    "phoneNumberCallee": "+39061234567", "duration": 184, "costs": 0.46,
    "start": "2026-01-15T10:30:00.000Z"
  }
]

Elencare le aziende partner

Per le integrazioni di partner e rivenditori, GET /partnerClients restituisce le aziende visibili collegate all’azienda autenticata. I relativi ID possono essere usati con il filtro businessId dell’endpoint di utilizzo.

curl --request GET \
  --url https://voicebooker.de/app/api/v1/partnerClients \
  --header 'Authorization: Bearer <il-tuo-token-api>'

Esempio di risposta:

[
  {
    "id": "zpjwletodo",
    "name": "Azienda partner di esempio",
    "city": "Roma",
    "country": "IT"
  }
]

Specifica OpenAPI

openapi: 3.1.0
info:
  title: VoiceBooker Partner API
  version: 1.0.0
  description: API per consultare aziende partner e dati di utilizzo.
servers: [{url: https://voicebooker.de/app/api/v1}]
paths:
  /exportBots/{botId}:
    get:
      summary: Esportare un bot
      operationId: exportBot
      security: [{bearerAuth: []}, {apiToken: []}]
      parameters:
        - {name: botId, in: path, required: true, schema: {type: string}}
        - {name: pretty, in: query, schema: {type: boolean, default: false}}
        - {name: nt, in: query, schema: {type: boolean, default: false}}
      responses:
        '200': {description: Definizione del bot esportato., content: {application/json: {schema: {type: object, properties: {id: {type: string}, name: {type: string}, stages: {type: array, items: {type: object}}, settings: {type: object}, wizard: {type: object}}}}}}
        '401': {$ref: '#/components/responses/Unauthorized'}
        '403': {description: Il bot non appartiene all’azienda del token.}
  /importBots:
    post:
      summary: Importare un bot
      operationId: importBot
      security: [{bearerAuth: []}, {apiToken: []}]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [contents]
              properties:
                filename: {type: string}
                contents: {oneOf: [{type: object}, {type: string}]}
                overwriteBotStages: {type: boolean, default: false}
                overwriteTemplates: {type: boolean, default: false}
                replaceBotStages: {type: boolean, default: false}
      responses:
        '200': {description: Bot importato., content: {application/json: {schema: {type: object, properties: {id: {type: string}, name: {type: string}}}}}}
        '401': {$ref: '#/components/responses/Unauthorized'}
  /makeCall:
    post:
      summary: Effettuare una chiamata in uscita
      operationId: makeOutboundCall
      security: [{tokenAuth: []}]
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [dest, botId, sipAccountId]
              properties:
                dest: {type: string}
                botId: {type: string}
                sipAccountId: {type: string}
                ringTimeout: {type: integer, default: 30}
                startTimeout: {type: integer, default: 0}
                state: {type: object, additionalProperties: true}
      responses:
        '200': {description: Chiamata in uscita avviata., content: {application/json: {schema: {type: object, properties: {callId: {type: string}}}}}}
        '401': {$ref: '#/components/responses/Unauthorized'}
  /usage:
    get:
      summary: Recuperare l’utilizzo
      operationId: listUsage
      security: [{bearerAuth: []}, {apiToken: []}]
      parameters:
        - {name: businessId, in: query, schema: {type: string}, description: Azienda da consultare.}
        - {name: start, in: query, schema: {type: string, format: date-time}, description: Inizio incluso.}
        - {name: end, in: query, schema: {type: string, format: date-time}, description: Fine inclusiva.}
      responses:
        '200': {description: Dati di utilizzo., content: {application/json: {schema: {type: array, items: {$ref: '#/components/schemas/UsageRecord'}}}}}
        '401': {$ref: '#/components/responses/Unauthorized'}
        '403': {description: L’azienda non è disponibile per questo token.}
  /partnerClients:
    get:
      summary: Elencare le aziende partner
      operationId: listPartnerClients
      security: [{bearerAuth: []}, {apiToken: []}]
      responses:
        '200': {description: Elenco delle aziende., content: {application/json: {schema: {type: array, items: {$ref: '#/components/schemas/PartnerBusiness'}}}}}
        '401': {$ref: '#/components/responses/Unauthorized'}
components:
  securitySchemes:
    tokenAuth: {type: apiKey, in: header, name: Token}
    bearerAuth: {type: http, scheme: bearer}
    apiToken: {type: apiKey, in: header, name: X-API-Token}
  schemas:
    PartnerBusiness: {type: object, properties: {id: {type: string}, name: {type: string}}}
    UsageRecord:
      type: object
      properties:
        id: {type: string}
        businessId: {type: string}
        botId: {type: string, nullable: true}
        isCall: {type: boolean}
        direction: {type: string, enum: [inbound, outbound]}
        phoneNumberCaller: {type: string, nullable: true}
        phoneNumberCallee: {type: string, nullable: true}
        duration: {type: integer}
        costs: {type: number}
        start: {type: string, format: date-time}
  responses:
    Unauthorized: {description: Il token manca o non è valido.}

Errori HTTP

  • 401 Unauthorized: il token API manca o non è valido.
  • 403 Forbidden: l’azienda richiesta non è disponibile per questo token.

In questa pagina