Skip to content

Incoming Calls API Documentation

This document provides details for the API endpoints used to manage and retrieve incoming call records.

Base URL

All endpoint URLs in this documentation are relative to the following base URL:

https://admin.rinble.com/index.php?r=apiv1/incoming-calls

Authentication

All API requests must be authenticated using a token. The token must be sent as a parameter (token) in every request, either in the query string for GET requests or in the request body for POST requests.

Example GET request with token:

https://admin.rinble.com/index.php?r=apiv1/incoming-calls/index&token=YOUR_API_TOKEN

If the token is missing, invalid, or expired, the API will respond with a 401 Unauthorized error.

{
    "status": 0,
    "error_code": 401,
    "message": "Please provide access token"
}

Endpoints

1. List Call Records

Retrieves a list of call detail records. This endpoint can be used to get all unaccessed calls or search for calls within a specific date range. By default, fetching records marks them as "accessed"; this behavior can be overridden.

  • Endpoint: /index
  • Methods: GET, POST

Parameters

Parameter Type Required Default Description
token string Yes Your API access token.
fromDate string No Start date for filtering (YYYY-MM-DD). If used, toDate is also required. If omitted, the API retrieves unaccessed calls.
toDate string No End date for filtering (YYYY-MM-DD). If used, fromDate is also required.
doNotMarkAsAccessed string No If set to Y, the retrieved call records will not be marked as accessed by the API.
limit integer No 1000 The maximum number of records to return. The hard limit is 1000.
src string No Filter records by the source phone number (10 digits).
dst string No Filter records by the destination phone number (10 digits).

Success Response (200 OK)

{
    "status": 1,
    "totalItems": 1,
    "data": [
        {
            "uniqueid": "1678886400.12345",
            "clid": "\"John Doe\" <1234567890>",
            "src": "1234567890",
            "dst": "0987654321",
            "dcontext": "from-internal",
            "duration": 60,
            "start": "2023-03-15 12:00:00",
            "calldate": "2023-03-15 12:00:00",
            "end": "2023-03-15 12:01:00",
            "billsec": 55,
            "answer": "2023-03-15 12:00:05"
        }
    ]
}

2. View a Single Call Record

Retrieves the details for a single call record, identified by its uniqueid.

  • Endpoint: /view
  • Methods: GET, POST

Parameters

Parameter Type Required Description
token string Yes Your API access token.
uniqueid string Yes The unique identifier of the call record.

Success Response (200 OK)

{
    "status": 1,
    "data": {
        "calldetail_id": 101,
        "uniqueid": "1678886400.12345",
        "clid": "\"John Doe\" <1234567890>",
        "src": "1234567890",
        "dst": "0987654321",
        "dcontext": "from-internal",
        "dst_account_id": 50,
        "accessed_by_api_date": null,
        "accessed_by_api_token_id": null
        // ... other Calldetail model attributes
    }
}

Error Response (400 Bad Request)

If the call record is not found for the associated account.

{
    "status": 0,
    "error_code": 400,
    "message": "Call record not found"
}

3. Download a Call Recording

Downloads the audio recording associated with a call record. The file will be either an MP3 or WAV file.

  • Endpoint: /download-recording
  • Method: GET

Parameters

Parameter Type Required Description
token string Yes Your API access token.
uniqueid string Yes The unique identifier of the call record.

Success Response (200 OK)

The body of the response will be the raw audio file (.mp3 or .wav) with the appropriate Content-Type header and a Content-Disposition header set to trigger a download.

Error Response

If the call is not found, or the user is not authorized, a standard JSON error will be returned. If the recording file does not exist on the server, the request may be redirected.