POST /v1/flows/{id}/test
const url = 'https://seu-endereco-da-api/v1/flows/example/test';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"graph":{"nodes":[{}],"edges":[{}]},"contactId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","channelId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","input":{"kind":"start","text":"example"},"state":{"waitingNodeId":"example","attempts":1,"vars":{},"agentMessages":[{"role":"user","content":"example"}],"warned":["example"]}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://seu-endereco-da-api/v1/flows/example/test \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "graph": { "nodes": [ {} ], "edges": [ {} ] }, "contactId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "channelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "input": { "kind": "start", "text": "example" }, "state": { "waitingNodeId": "example", "attempts": 1, "vars": {}, "agentMessages": [ { "role": "user", "content": "example" } ], "warned": [ "example" ] } }'Permissão que a Chave de acesso precisa: Gerenciar fluxos (flows:manage).
Authorizations
Seção intitulada “Authorizations”Parameters
Seção intitulada “Parameters”Path Parameters
Seção intitulada “Path Parameters”Request Bodyrequired
Seção intitulada “Request Bodyrequired”object
object
object
object
object
object
object
object
Responses
Seção intitulada “Responses”object
object
What the panel shows: the message, the template text, the described action, the wait, the api response, the agent reply, the described charge or the offered slots
Media kind, template name, action type, api mode (exemplo or de_verdade), agent name or why the test stopped
object
Null when the test ended
object
The Pergunta, Agendamento or Agente block the test waits on
The test variables only; send it back as is on the next call
object
The agent conversation of the test; send it back as is on the next call
object
The warnings already shown in this test, so the next call does not repeat them; send it back as is
What would go wrong live on this turn, one per warning and block in the whole test
object
The block the warning belongs to
What would go wrong live, ready to show
Example
{ "events": [ { "kind": "mensagem" } ], "steps": [ { "outcome": "passou" } ], "state": { "agentMessages": [ { "role": "user" } ] }, "warnings": [ { "code": "channel_disconnected" } ]}