Only this pageAll pages
Powered by GitBook
1 of 10

V1

Loading...

Response Code

Loading...

Loading...

Loading...

Loading...

Endpoint

Loading...

Loading...

Loading...

Getting Started

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

URL ENDPOINT : https://email.ocatelkom.co.id/api/v1

API Documentation Email API V1

Error Messages

OCA EMAIL 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}]}

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 EMAIL 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

13

Internal Error

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

Email Detail / Status

HTTP Method : GET

Endpoint URL : https://email.ocatelkom.co.id/api/v1/email/status/(fill_with_email_id)

Response

Property
Type

email

String (Destination Email)

message_body

Authentication

In order to hit OCA EMAIL OTP API Gateway Endpoint, client must be authenticated. OCA EMAIL 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: [email protected]

Password: test123

Base64Function([email protected]:test123) => dGVzdEBnbWFpbC5jb206dGVzdDEyMw==

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

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

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.

String

created_at

ISO Date

status

String (status of email. opened, delivered, failed, etc)

msg_id

String

{
    "status": true,
    "data": {
        "email": "[email protected]",
        "message_body": "<p>Oca Message</p>",
        "created_at": "2020-03-10T11:00:00.000Z",
        "status": "opened",
        "msg_id": "xxxxhu7f900sdr8xxxx"
    }
}
curl \ 
    --header "Content-Type: application/json" \
    --header "Authorization: Basic dhu7ujuejxxxxxxxxxx==" \
    --request GET \
    https://call.ocatelkom.co.id/api/v1

Send Email

HTTP Method : POST

Content_Type : application/json

Endpoint URL : https://email.ocatelkom.co.id/api/v1/send-single

FORM DATA:

Property
Type

email

String (Destination Email To)

Response

Property
Type

Email History

HTTP Method : GET

Endpoint URL : https://email.ocatelkom.co.id/api/v1/email/history

Response : In Array/LIst

Property
Type

email

String (Destination Email)

message_body

HTTP Status Codes

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

Code
Text
Description

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

200

OK

Success

401

Unauthorized

Missing or Incorrect authentication details

404

Not Found

message

Base64Function(String) (Message body – HTML code)

sender_email

String (Sender email - From)

sender_name

String (Sender name - From)

subject

String (Subject of email)

attachment

file - optional

success

Boolean

msg_id

String

String

created_at

ISO Date

status

String (status of email. opened, delivered, failed, etc)

msg_id

String

[
    {
        "email": "[email protected]",
        "message_body": "<h1>Oca Message</h1>",
        "created_at": "2020-03-10T11:00:00.000Z",
        "status": "delivered",
        "msg_id": "xxxxhu7f900sdr8xxxx"
    },
    {
        "email": "[email protected]",
        "message_body": "<p>Oca Message</p>",
        "created_at": "2020-03-10T11:00:00.000Z",
        "status": "opened",
        "msg_id": "xxxxhu7f900sdr8xxxx"
    },
]
{
    "status": true,
    "msg_uid": "d3a925xxxxxxxxxxxxd2f2d"
}