Only this pageAll pages
Powered by GitBook
1 of 10

V1

Loading...

Response Code

Loading...

Loading...

Loading...

Loading...

endpoint

Loading...

Loading...

Loading...

Getting Started

The OCA SMS Premium Gateway offers a solution for sending OTP messages. To access the OCA SMS OTP Gateway, we provide an API Endpoint URL that clients can use.

Endpoint URL:

https://webapigw.ocatelkom.co.id

OCA SMS Premium Gateway

Error Messages

OCA SMS OTP 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.

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

Authentication

In order to hit OCA SMS OTP API Gateway Endpoint, client must be authenticated. OCA SMS OTP API Gateway uses Basic Authentication. Username and password must be encoded with base64 separated by colon and put the encoded credentials into Authorization Header.

Example:

Username: test@gmail.com

Password: test123

Base64Function(test@gmail.com:test123) => dGVzdEBnbWFpbC5jb206dGVzdDEyMw==

Please attach Credentials in Authorization header in your http request like this:

curl \ 
    --header "Content-Type: application/json" \
    --header "Authorization: Basic dhu7ujuejxxxxxxxxxx==" \
    --request GET \
    https://call.ocatelkom.co.id/api/v1

Numbers Collection

OCA Provides a collection of numbers (Masking) that can be used as the sender id number for each sms otp will be sent

HTTP Method : GET

Endpoint URL

 https://webapigw.ocatelkom.co.id/sms/v1/number

Response:

Property
Type

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 SMS OTP 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

HTTP Status Code

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

Code
Text
Description

Send SMS OTP

HTTP Method : POST

Endpoint URL

Request Body

Property
Type

SMS Detail / Status

HTTP Method : GET

Endpoint URL

Response

Property
Type

sender_id

Array

{
    "sender_id":[
        "OCA ID"
    ]
}

13

Internal Error

200

OK

Response:

Property
Type

https://webapigw.ocatelkom.co.id/sms/v1/send-otp

sender_id

 https://webapigw.ocatelkom.co.id/sms/v1/otp-status/(fill_with_msg_id)

Corresponds with HTTP 500. An unknown internal error occured

17

Invalid Authentication Credentials

Corresponds with HTTP 401. It indicates the credential is missing or incorrect

19

Missing Authorization Header

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

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 - invalid input country code

Destination of phone number Values : country code + phone number

valid example : (+6281381475159, 6281381475159)

41

User Is Not Exist

Corresponds with HTTP 404. The certain user setting is not found

51

Account Expired

Corresponds with HTTP 401. It indicates the client Account is Expired.

55

Your Quota Is not Enough

Corresponds with HTTP 401. It indicates the client Quota is Runs Out.

Success

401

Unauthorized

Missing or Incorrect authentication details

404

Not Found

There is no data available, like user setting etc

406

Not Acceptable

Response when there is invalid format in request

500

Internal Server Error

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

String (numbers or masking number that get from numbers collection)

receipent_number

String (Destination phone number) Values : country code + phone number (+6281381475159, 6281381475159)

message_body

String (Message body)

sender_id

Boolean

msg_id

String

{
    "sender_id": true,
    "msg_id": "xxxxx898hr47yxxxx"
}
{
    "errors": [
        {
            "message": [
                {
                    "value": "89694353628",
                    "msg": "Invalid country code",
                    "param": "phone_number",
                    "location": "body"
                }
            ],
            "code": "39"
        }
    ]
}

sender_id

SString (Phone numbers that get from numbers collection)

receipent_number

String (Destination phone number)

message_body

String (Message body)

msg_id

String

created_at

ISO Date

updated_at

ISO Date

status

String

{
    "sender_id": "Telkom"
    "receipent_number": "+628123xxxxx"
    "message_body": "Message"
}
{
    "sender_id": "Telkom",
    "receipent_number": "+628123xxxxx",
    "message_body": "Message",
    "status": "sent",
    "created_at": "2023-03-01T03:22:58.073Z",
    "updated_at": "2023-03-01T03:22:58.073Z",
    "msg_id": "xxxx0a123d4ref543xxxx"
}