Quickstart

Token

In this Quickstart, you’ll learn how to sign up and generate to your token.

Sign up to VoIPBin

Send the sign up request to pchero21@gmail.com

Generate token

To generate jwt token, you need to send the request with your username and password like the below.

$ curl --request POST 'https://api.voipbin.net/auth/login' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "username": "your-voipbin-username",
        "password": "your-voipbin-password"
    }'

{
    "username": "voipbin",
    "token": "eyJhbsdiOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lciI6IntcImlkXCI6XCI1ZTRhMDY4MC04MDRlLTExZWMtODQ3Ny0yZmVhNTk2OGQ4NWJcIixcInVzZXJuYW1lXCI6XCJhZG1pblwiLFwibmFtZVwiOlwiYWRtaW5cIixcImRldGFpbFwiOlwiYWRtaW4gYWNjb3VudFwiLFwid2ViaG9va19tZXRob2RcIjpcIlBPU1RcIixcIndlYmhvb2tfdXJpXCI6XCJodHRwczovL2VubG1ieXVqamowbWcueC5waXBlZHJlYW0ubmV0XCIsXCJsaW5lX3NlY3JldFwiOlwiYmE1ZjA1NzVkODI2ZDViNGEwNTJhNDMxNDVlZjEzOTFcIixcImxpbmVfdG9rZW5cIjpcInRzZklpREIvMmNHSTVzSFJNSW9wN1MzU1M0S3NiRWxKL3VrUUtzNkxwSFkxWG9HMnBUTUhxZGl5TE51OGFNZGEycGkzdlRYc2NDS3A4WEdFdmZsNmRtSVQxbmZUVGRNa21ZODRpUkxJT0lBbDg1aUcvWFp1ZUkxV0JSdmNoZlY4VGxad0RtRUNiU1N6TCtXdXYrak8rZ2RCMDR0ODkvMU8vdzFjRG55aWxGVT1cIixcInBlcm1pc3Npb25faWRzXCI6W1wiMDM3OTZlMTQtN2NiNC0xMWVjLTlkYmEtZTcyMDIzZWZkMWM2XCJdLFwidG1fY3JlYXRlXCI6XCIyMDIyLTAyLTAxIDAwOjAwOjAwLjAwMDAwMFwiLFwidG1fdXBkYXRlXCI6XCIyMDIzLTAyLTIxIDA4OjAxOjEyLjI2MDM4OFwiLFwidG1fZGVsZXRlXCI6XCI5OTk5LTAxLTAxIDAwOjAwOjAwLjAwMDAsMFwifSIsamV4cCI6MTY4MDcxNTQ5M30.mEYsKYdRnoVGVOl7Zk21YBbxMvD-0lD1dlQVnav4kRw"
}

The token is valid for 7 days.

Call

In this Quickstart, you’ll learn how to make an outbound voice call.

Make your first voice call with manual actions

Use the Voipbin API to initiate an outbound telephone call from your Voipbin account.

$ curl --location --request POST 'https://api.voipbin.net/v1.0/calls?token=your-voipbin-token' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "source": {
            "type": "tel",
            "target": "+82XXXXXXXX"
        },
        "destinations": [
            {
                "type": "tel",
                "target": "+82XXXXXXXX"
            }
        ],
        "actions": [
            {
                "type": "talk",
                "option": {
                    "text": "Hello. This is voipbin test. The voipbin provides ready to go CPaaS service. Thank you, bye.",
                    "gender": "female",
                    "language": "en-US"
                }
            }
        ]
    }'

[
    {
        "id": "e2a65df2-4e50-4e37-8628-df07b3cec579",
        "customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
        "flow_id": "6cbaa351-b112-452d-84c2-01488671013d",
        "type": "flow",
        "master_call_id": "00000000-0000-0000-0000-000000000000",
        "chained_call_ids": [],
        "recording_id": "00000000-0000-0000-0000-000000000000",
        "recording_ids": [],
        "source": {
            "type": "tel",
            "target": "+821028286521",
            "target_name": "",
            "name": "",
            "detail": ""
        },
        "destination": {
            "type": "tel",
            "target": "+821021656521",
            "target_name": "",
            "name": "",
            "detail": ""
        },
        "status": "dialing",
        "action": {
            "id": "00000000-0000-0000-0000-000000000001",
            "next_id": "00000000-0000-0000-0000-000000000000",
            "type": ""
        },
        "direction": "outgoing",
        "hangup_by": "",
        "hangup_reason": "",
        "tm_progressing": "9999-01-01 00:00:00.000000",
        "tm_ringing": "9999-01-01 00:00:00.000000",
        "tm_hangup": "9999-01-01 00:00:00.000000",
        "tm_create": "2023-03-28 12:00:05.248732",
        "tm_update": "9999-01-01 00:00:00.000000",
        "tm_delete": "9999-01-01 00:00:00.000000"
    }
]

Make your first voice call with existed flow

Use the Voipbin API to initiate an outbound telephone call with existed flow.

$ curl --location --request POST 'https://api.voipbin.net/v1.0/calls?token=your-voipbin-token' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "source": {
            "type": "tel",
            "target": "<your source number>"
        },
        "destinations": [
            {
                "type": "tel",
                "target": "<your destination number>"
            }
        ],
        "flow_id": "ed95a3c4-22d4-11ee-add7-8742a741581e",
    }'

[
    {
        "id": "e2a65df2-4e50-4e37-8628-df07b3cec579",
        "customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
        "flow_id": "ed95a3c4-22d4-11ee-add7-8742a741581e",
        "type": "flow",
        "master_call_id": "00000000-0000-0000-0000-000000000000",
        "chained_call_ids": [],
        "recording_id": "00000000-0000-0000-0000-000000000000",
        "recording_ids": [],
        "source": {
            "type": "tel",
            "target": "+821028286521",
            "target_name": "",
            "name": "",
            "detail": ""
        },
        "destination": {
            "type": "tel",
            "target": "+821021656521",
            "target_name": "",
            "name": "",
            "detail": ""
        },
        "status": "dialing",
        "action": {
            "id": "00000000-0000-0000-0000-000000000001",
            "next_id": "00000000-0000-0000-0000-000000000000",
            "type": ""
        },
        "direction": "outgoing",
        "hangup_by": "",
        "hangup_reason": "",
        "tm_progressing": "9999-01-01 00:00:00.000000",
        "tm_ringing": "9999-01-01 00:00:00.000000",
        "tm_hangup": "9999-01-01 00:00:00.000000",
        "tm_create": "2023-03-28 12:00:05.248732",
        "tm_update": "9999-01-01 00:00:00.000000",
        "tm_delete": "9999-01-01 00:00:00.000000"
    }
]

Queue

In this Quickstart, you’ll learn how to set the queue.

Create your first queue

$ curl --location --request POST 'https://api.voipbin.net/v1.0/queues?token=your-voipbin-token' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "name": "test queue",
        "detail": "test queue detail",
        "routing_method": "random",
        "tag_ids": ["d7450dda-21e0-4611-b09a-8d771c50a5e6"],
        "wait_actions": [
            {
                "type":"talk",
                "option": {
                    "text": "Hello. This is test queue. Please wait.",
                    "gender": "female",
                    "language": "en-US"
                }
            },
            {
                "type": "sleep",
                "option": {
                    "duration": 1000
                }
            }
        ],
        "timeout_wait": 100000,
        "timeout_service": 10000000
    }'

{
    "id": "99bf739a-932f-433c-b1bf-103d33d7e9bb",
    "customer_id": "5e4a0680-804e-11ec-8477-2fea5968d85b",
    "name": "test queue",
    "detail": "test queue detail",
    "routing_method": "random",
    "tag_ids": [
        "d7450dda-21e0-4611-b09a-8d771c50a5e6"
    ],
    "wait_actions": [
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "next_id": "00000000-0000-0000-0000-000000000000",
            "type": "talk",
            "option": {
                "text": "Hello. This is test queue. Please wait.",
                "gender": "female",
                "language": "en-US"
            }
        },
        {
            "id": "00000000-0000-0000-0000-000000000000",
            "next_id": "00000000-0000-0000-0000-000000000000",
            "type": "sleep",
            "option": {
                "duration": 1000
            }
        }
    ],
    "wait_timeout": 100000,
    "service_timeout": 10000000,
    "wait_queuecall_ids": [
        "65b3f8c3-ce8e-4a5d-ae13-598aa2889377"
    ],
    "service_queuecall_ids": [],
    "total_incoming_count": 228,
    "total_serviced_count": 169,
    "total_abandoned_count": 99,
    "tm_create": "2021-12-24 06:33:10.556226",
    "tm_update": "2023-03-07 12:39:54.664143",
    "tm_delete": "9999-01-01 00:00:00.000000"
}