Tutorial

Prerequisites

Before working with activeflows, you need:

  • An authentication token. Obtain one via POST /auth/login or use an access key from GET /accesskeys.

  • (To inspect an existing one) An activeflow ID (UUID). Activeflows are also created automatically when a flow is triggered (e.g., by an incoming call or POST /calls). List them via GET /activeflows.

Note

AI Implementation Hint

You can create an activeflow directly via POST /activeflows by supplying either a flow_id (to run an existing flow) or an inline actions array. Activeflows are also created automatically when a flow is triggered by another resource, such as an incoming call or POST /calls. To inspect one, list activeflows with GET /activeflows. The status field will be running during execution and ended after completion.

Get activeflow list

Getting a list of activeflows.

$ curl -k --location --request GET 'https://api.voipbin.net/v1.0/activeflows?token=<YOUR_AUTH_TOKEN>'

{
    "result": [
        {
            "id": "6f18ae1c-ddf8-413b-9572-ad30574604ef",
            "customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
            "flow_id": "93993ae1-0408-4639-ad5f-1288aa8d4325",
            "status": "ended",
            "reference_type": "call",
            "reference_id": "fd581a20-2606-47fd-a7e8-6bba7c294170",
            "reference_activeflow_id": "00000000-0000-0000-0000-000000000000",
            "on_complete_flow_id": "00000000-0000-0000-0000-000000000000",
            "current_action": {
                "id": "93ebcadb-ecae-4291-8d49-ca81a926b8b3",
                "next_id": "00000000-0000-0000-0000-000000000000",
                "type": "digits_receive",
                "option": {
                    "length": 1,
                    "duration": 5000
                }
            },
            "forward_action_id": "00000000-0000-0000-0000-000000000000",
            "executed_actions": [],
            "tm_create": "2023-04-06T14:53:12Z",
            "tm_update": "2023-04-06T14:54:24Z",
            "tm_delete": null
        },
        ...
    ],
    "next_page_token": "2023-04-02T13:43:30Z"
}

Stop activeflow

Stop the activeflow.

$ curl --location --request POST 'https://api.voipbin.net/v1.0/activeflows/1cb0566c-6aa5-45fd-beb7-e71a968075ea/stop?token=<YOUR_AUTH_TOKEN>'

{
    "id": "1cb0566c-6aa5-45fd-beb7-e71a968075ea",
    "customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
    "flow_id": "93993ae1-0408-4639-ad5f-1288aa8d4325",
    "status": "ended",
    "reference_type": "call",
    "reference_id": "cd40b5f5-dafc-43e6-9b70-38edc1155a0f",
    "reference_activeflow_id": "00000000-0000-0000-0000-000000000000",
    "on_complete_flow_id": "00000000-0000-0000-0000-000000000000",
    "current_action": {
        "id": "f9720d64-a8a8-11ed-8853-3f29a447aac1",
        "next_id": "00000000-0000-0000-0000-000000000000",
        "type": "talk",
        "option": {
            "text": "Hello. Welcome to the VoIPBIN service. Please select a service. For simple talk, press 1. For simple transcribe, press 2. For queue join, press 3. For voicemail, press 4. For conference, press 5. For chatbot talk, press 6. To contact support, press 0.",
            "language": "en-US",
            "digits_handle": "next"
        }
    },
    "forward_action_id": "00000000-0000-0000-0000-000000000000",
    "executed_actions": [],
    "tm_create": "2023-04-07T17:23:33Z",
    "tm_update": "2023-04-07T17:23:52Z",
    "tm_delete": null
}