Skip to main content
All CollectionsCRMs Connection and IntegrationWebhooks
API Documentation: Aloware Two-Legged Call API Integration
API Documentation: Aloware Two-Legged Call API Integration

Aloware's Two-Legged Call API automates calls with api_token and user/line details. Confirm setup with HTTP 202, errors with HTTP 422.

Laarni D avatar
Written by Laarni D
Updated over 8 months ago

The Aloware Two-Legged Call API enables direct phone calls between your contacts and agents, offering a streamlined and automated calling workflow.

This comprehensive documentation provides all the necessary information, including required fields and examples, to successfully integrate the Aloware Two-Legged Call API into your applications.


Common Use-Cases in Business:

  1. Call Center Automation

    Improve efficiency in call centers by automating outbound calls. With the Two-Legged Call API integrated into your call center software, agents can seamlessly connect with customers. The API initiates direct phone calls, eliminating manual dialing and enhancing productivity. You can also track call data for analysis purposes, such as call duration and outcomes.

  2. Appointment Reminder System

    Enhance appointment-based businesses like medical clinics or salons by automating appointment reminders. By integrating the Two-Legged Call API with your appointment management software, you can initiate phone calls to customers as their appointment time approaches. Pre-recorded messages can be delivered, reducing no-shows and freeing up staff from manual reminder calls.

These are just a couple of examples showcasing the versatility of the Two-Legged Call API. It can be used in various scenarios where direct phone calls between contacts and agents are necessary, enabling businesses to streamline communication and optimize their processes.


Endpoint

POST /api/v1/webhook/two-legged-call

Establishing a Two-Legged Call

To establish a two-legged call, you need the following required fields:

api_token

Your Aloware account API token.

user_id or ring_group_id

Either the ID of the user or the ring group involved in the call.

contact_phone_number or contact_id

The phone number or ID of the contact you want to establish the call with.

line_phone_number or line_id

The phone number or ID of the Aloware line to initiate the call from.

Optional fields

user_phone_number

The phone number of the user if user_id is selected.

Example POST URL

https://app.aloware.com/api/v1/webhook/two-legged-call

Example POST Body

Here are some examples of JSON payloads to establish two-legged calls using the Aloware Two-Legged Call API:

  1. Two-Legged Call with Line Phone Number

    {
    "api_token": "CC42FF74",
    "ring_group_id": "1",
    "contact_phone_number": "+18181276543",
    "line_phone_number": "+18552562001"
    }
  2. Two-Legged Call with Line ID

    {
    "api_token": "CC42FF74",
    "ring_group_id": "1",
    "contact_id": "1234",
    "line_phone_number": "+18552562001"
    }
  3. Two-Legged Call with User ID and User Phone Number using Line Phone Number

    {
    "api_token": "CC42FF74",
    "user_id": "1",
    "user_phone_number": "+18181234567",
    "contact_phone_number": "+18181276543",
    "line_phone_number": "+18552562001"
    }
  4. Two-Legged Call with User ID and User Phone Number using Line ID

    {
    "api_token": "CC42FF74",
    "user_id": "1",
    "user_phone_number": "+18181234567",
    "contact_id": "1234",
    "line_phone_number": "+18552562001"
    }

Example POST Header

Accept: application/json
Content-Type: application/json

Response

  • HTTP 202 - Two-legged call established successfully.

    {
    "message": "Two-legged call established."
    }

  • HTTP 422 - Failure with a detailed response.

    {
    "message": "The given data was invalid.",
    "errors": {
    "contact_phone_number": [
    "The contact_phone_number field is required when contact_id is empty."
    ],
    "contact_id": [
    "The contact_id field is required when contact_phone_number is empty."
    ],
    "line_phone_number": [
    "The line_phone_number field is required when line_id is empty."
    ],
    "line_id": [
    "The line_id field is required when line_phone_number is empty."
    ],
    "user_id": [
    "The user_id field is required."
    ]
    }
    }

cURL Examples - Establish two-legged calls

  1. Two-Legged Call with Phone Number

    curl -X POST \
    https://app.aloware.com/api/v1/webhook/two-legged-call \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
    "api_token": "CC42FF74",
    "ring_group_id": "1",
    "contact_phone_number": "+18181276543",
    "line_phone_number": "+18552562001"
    }'

  2. Two-Legged Call with Line ID

    curl -X POST \
    https://app.aloware.com/api/v1/webhook/two-legged-call \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
    "api_token": "CC42FF74",
    "ring_group_id": "1",
    "contact_id": "1234",
    "line_phone_number": "+18552562001"
    }'

  3. Two-Legged Call with User ID and User Phone Number

    curl -X POST \
    https://app.aloware.com/api/v1/webhook/two-legged-call \
    -H 'Accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{
    "api_token": "CC42FF74",
    "user_id": "1",
    "user_phone_number": "+18181234567",
    "contact_phone_number": "+18181276543",
    "line_phone_number": "+18552562001"
    }'

If you need more API functions or have any questions, please don't hesitate to reach out to our support team at [email protected]. We're here to assist you with your specific requirements.

Did this answer your question?