Only this pageAll pages
Powered by GitBook
1 of 14

V2

Loading...

Response Code

Loading...

Loading...

Loading...

Loading...

endpoint

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Getting Started

OCA CALL Gateway provide solution to send SMS. In order to hit the OCA CALL Gateway, we provide Endpoint url, so client can hit and use the API.

OCA Endpoint URL : https://webapigw.ocatelkom.co.id

Before you start

You will need :

  • OCA API Dashboard account username and password

  • you have created IVR on blast dashboard

IVR Designer

Before you can make a call, you need to make the IVR (Interactive Voice Response) first. In order to make ivr you should log in to dashboard, you can visit https://dashboard.ocatelkom.co.id. Please provide your username and password to log in.

To start making ivr please select IVR menu OCA Blast -> Voice -> IVR and Press Add ivr button to start design your ivr.

We want to show you how to build ivr with dynamic audio, so you can play audio dynamicallya from api trigger call. You can start with choose component Play External Audio, drag and drop the component to the board, as shown in the picture below.

In the component editor, on the right side, you will see the form for specific component, please fill the Audio Url with dynamic variable start with “{{“ symbol and end with “}}” symbol, as shown in the picture below.

Error Codes

This error codes is additional information to explain what happened when some errors occured. The following table describe the code which may appear when working with OCA CALL Gateway. If an error is not listed in the table, going back to HTTP status codes above in order to determine the best way to address the issues.

Code
Text
Description

5

low-balance

Indicationg that your account has no enough balance left

9

Too Many Request Code

Due to the api rate limit, you have to wait until the currently window wxpires, the default api rate limit is in 25 request per seconds. You can check http headers reaponse in order to know the remaining limit of your request. - X-RateLimit-limit : the rate limit of endpoint - X-RateLmit-Remaining : the number of request left - X-RateLimit-Reset : the remaining window before the rate limit resets

13

Response Code

The OCA Call Gateway attempts to return the appropriate HTTP Status Codes for every request

Code
Text
Description

Error Message

OCA CALL error messages are returned in JSON Format. Each HTTP Status Code will be accompanied by descriptive error text and code. For example, an error might occur.

Delete Audio File

HTTP Method : DELETE

Endpoint URL :

Response:

Property
Type

Internal Error

Corresponds with HTTP 500. An unknown internal error occured

19

Missing Authorization Header

Corresponds with HTTP 401. It indicates Authorization header is not set properly

33

Data doesn't exist

Corresponds with HTTP 404. The certain data is not found

39

[object]

Corresponds with HTTP 406. There are incorrects or missing parameter in request body, it is like the message_value is not same as the template message

43

Auth token is not supplied

Corresponds with HTTP 401. It indicates Authorization header is not set properly

45

Auth token is not valid

Corresponds with HTTP 401. It indicates Authorization token is not valid

59

Whatsapp Template doesn't exist Code

Corresponds with HTTP 406. Your message template doesn't exist

status

String (success)

https://webapigw.ocatelkom.co.id/call/v2/delete-audio/{{fill_with_audio_id}}

Get List Number Collection

OCA Provides a collection of numbers that can be used as the caller id number for each call that is made

HTTP Method : GET

Endpoint URL : https://webapigw.ocatelkom.co.id/call/v2/number-collection

Response List (Array)

Property
Type

phone_number

Array

{
        "phone_number": [
                "021812345678",
                "021812345679",
                "021812345677",
                "021812345674",
                "021812345672",
        ]
}

There is no data available, like user setting etc

406

Not Acceptable

Response when there is invalid format in request

429

To Many Request

Returned when a request cannot be served due to the system's rate limit having been exhausted for the resource

500

Internal Server Error

Something is broken. This is usually a temporary error in server

200

OK

Success

401

Unauthorized

Missing or Incorrect authentication details

404

Not Found

{"errors": [{"message": "Invalid Authentication Credentials", "code": 17}]}

Make A Call With Dymanic Variable

If the Variable used is "name", simply fill in the "name" variable in the variable field in the request body with the String data type. If the Variable used is "audio", please get your audio url from the audio upload process above and enter the url in the variable field in the request body

HTTP Method : GET

Endpoint URL : https://webapigw.ocatelkom.co.id/call/v2/call

Request Body:

Property
Type

from_number

String (Phone numbers that get from numbers collection) Required

Response:

Property
Type

Get List Audio

HTTP Method : GET

Endpoint URL :

Response List (Array)

Property
Type

Upload Audio File

Upload audio file is method to store your audio file in OCA’s cloud storage, you can retrieve your audio by url that oca provide after you successfully upload your audio.

HTTP Method : POST

Endpoint URL :

Form Data (Body)

Property
Type

Authorization

OCA CALL provides an authorization method for you to access our resources, which we primarily use Access Token JSON Web Token (JWT). You can get the Access Token by generating it on our API dashboard.

Generate Access Token

This is the initial display for users who have never generated an access token

Select the channel you want to generate an access token, then click the red button that says "Generate". then access token will be downloaded to your computer in the form of a .txt file.

Get List IVR

After you design your IVR, you can use the ivr to make call to your customer. Remember, you can add dynamic content in your ivr design. In order to use ivr you have to see what ivr that available in your account, the ivr list will show you ivr name, ivr id, and variable (data you must provide when you make a call).

HTTP Method : GET

Endpoint URL :

Response List (Array)

Property
Type
Response:
Property
Type

id

String

filename

String

name

String

url

URL String

{
    "id": "xxxxf03d61fae4001267xxxx",
    "filename": "df82xxxx-a5xx-44xx-86xx-57f4e7e8xxxx.mp3",
    "name":"OCA Audio Rekam.mp3",
    "url": "https://webapigw.ocatelkom.co.id/audio/play/df82xxxx-a5xx-44xx-86xx-57f4e7e8xxxx.mp3"
}

audio

File (accepted file is mp3)

https://webapigw.ocatelkom.co.id/call/v2/upload-audio

to_number

String (Destination phone number) Required

ivr_id

String (Get from ivr list) Required

variable

Object (filled with required variable and the value)

success

Boolean

call_id

String

{
    "from_number":"02184788xxx",
    "to_number":"081211122xxxx",
    "ivr_id":"xxxxgyutfgv6767768hgxxxx",
    "variable":{
        "name": "galih",
        "audio_1": "https://webapigw.ocatelkom.co.id/audio/play/df82xxxx-a5xx-44xx-86xx-57f4e7e8xxxx.mp3"
    }
}
{
    "success": true,
    "to_number":"xxxxfghjji10gdd112xxxx",
}

String

url

URL String

[
    {
        "id": "xxxxf03d61fae4001267xxxx",
        "filename": "df82xxxx-a5xx-44xx-86xx-57f4e7e8xxxx.mp3",
        "name":"OCA Audio Rekam.mp3",
        "url": "https://webapigw.ocatelkom.co.id/audio/play/df82xxxx-a5xx-44xx-86xx-57f4e7e8xxxx.mp3"
    },

id

String

filename

String

https://webapigw.ocatelkom.co.id/call/v2/list-recording

name

ivr_name

String

required_variabel

Array (string) (if you add dynamic content when you design your ivr then the variable must be provided in your call request)

created_at

ISO DATE

deleted_at

ISO DATE

[
    {
        "ivr_id": "xxxxf03d61fae4001267xxxx",
        "ivr_name": "Testing Call Recording",
        "required_variable":[],
        "created_at": "2024-03-01T03:22:58.073Z",
        "deleted_at"

ivr_id

String (it will use when you make a call)

https://webapigw.ocatelkom.co.id/call/v2/ivr-list

Get Call Detail / Status

HTTP Method : GET

Endpoint URL :

Response:

Property
Type
{
"id": "xxxx8c71g1fae4001267xxxx",
"filename": "adaaxxxx-a5xx-44xx-86xx-85f4e7e8xxxx.mp3",
"name":"OCA Audio Rekam.mp3",
"url": "https://webapigw.ocatelkom.co.id/audio/play/df82xxxx-a5xx-44xx-86xx-57f4e7e8xxxx.mp3"
},
]
:
"2024-03-01T03:22:58.073Z"
,
},
{
"ivr_id": "xxxxghyuikae4001267xxxx",
"ivr_name": "IVR Resti",
"required_variable":[
"name"
],
"created_at": "2024-03-01T03:22:58.073Z",
"deleted_at": "2024-03-01T03:22:58.073Z",
},
]

String (IVR ID )

call_id

Object (filled with required variable and the value)

call_start

ISO Date (call start ringing)

call_answer

ISO Date (call picked up by destination)

call_end

ISO Date (call ended by destination)

duration

Number (total duration from call made until call ended)

talk_duration

Number (total talk duration from call picked up by user until call hangup, Billing will be counting by talk_duration)

tta

Number (time to answer)

hangup_cause

String (status from system)

status

String (status of call. submitted, success, failed)

created_at

ISO Date

updated_at

ISO Date

result

Array Objects*

Response:

{
    "from_number": "62857xxxxxxx",
    "to_number":"081212xxxxxxxx",
    "ivr_id": "xxxxgyutfgv6767768hgxxxx",
    "call_id": "xxxxkya9iv6767768hgxxxx",
    "application_id": "xxxx708875682700297dxxxx"

*Sample Result : (Arrray Objects)

from_number

String (Phone numbers that get from numbers collection) Required

to_number

String (Destination phone number) Required

https://webapigw.ocatelkom.co.id/call/v2/call-status/{{fill_with_call_id}}

ivr_id

[
    {
        "question":"Sebutkan nama anda setelah tanda beep berikut, dan akhiri dengan menekan tanda pagar",
        "type":"record_speach",
        "answer":[
            "https://storage.oca.co.id/audio/xxxxgh78uj-xxxhu-60xx-5ff2ff69xxxxx.wav"
        ]
        
    },
    {
        "question":"Apakah anda sehat hari ini, tekan 1 jika sehat, tekan 2 jika kurang sehat",
        "type":"multiple_choice",
        "answer":[
            {
                "key": "1",
                "title": "Key 1",
                "total": 1 
            },
            {
                "key": "2",
                "title": "Key 2",
                "total": 0 
            }
        ]
        
    },
    {
        "question":"masukkan nomor rekening anda",
        "type":"collect_number",
        "answer":[
            "854672xxx"
        ]
        
    }
]
,
"call_start": "2024-07-31T18:01:06.000Z",
"call_answer": "2024-07-31T18:01:26.000Z",
"call_end": "2024-07-31T18:01:32.000Z",
"duration": 26,
"talk_duration": 6,
"tta": 20,
"hangup_cause": "NORMAL_CLEARING",
"status": "answered",
"created_at": "2024-07-31T18:01:32.680Z",
"updated_at": "2024-07-31T18:01:32.000Z"
"result": [...
]
}