This API helps you add robust messaging capabilities to your applications.
Using this REST API, you can send and receive SMS and E-MAIL messages, track the delivery of sent messages,
Schedule messages to send at a later time, and retrieve and modify message history.
The Labcom API is organized around REST. We use built-in HTTP features, like HTTP authentication and HTTP verbs,
which can be understood by off-the-shelf HTTP clients.
JSON will be returned in all responses from the API, including errors.
https://api.labcom.ao
All request bodies should have content type application/json and be valid JSON.
The Content-Type header must be set in all requests that include a JSON body:
Content-Type: application/json
Content-Type: application/json
You authenticate to the Zcomercial API by providing your API Key in the Authorization header of every request:
Authorization: [YOUR_API_KEY]
All API requests must be made over HTTPS. Calls made over plain HTTP will fail.
To authenticate, provide the API Key in the request header:
curl 'https://api.labcom.ao/v1' \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
Make sure to replace sferdfbGE47fb22eZvKYlo2Cc0fo87EHa in the example with your own API Key.
| 200 - OK | Everything worked as expected. |
|---|---|
| 400 - Bad Request | The request was unacceptable, often due to missing a required parameter. |
| 401 - Unauthorized | No valid API key provided. |
| 402 - Request Failed | The parameters were valid but the request failed. |
| 404 - Not Found | The requested resource doesn't exist. |
| 409 - Conflict | The request conflicts with another request (perhaps due to using the same idempotent key). |
| 429 - Too Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
| 500, 502, 503, 504 - Server Errors | Something went wrong on example's end. (These are rare.) |
Labcom API helps you send and manage messages programmatically.
To sens sms you must specify at least an number and the content.
A sms will have the following attributes
(all attributes, except custom_fields, have JSON strings as values):
This endpoint retrieves all sms in the system, sorted by descending order of creation date.
curl "https://api.labcom.ao/v1/sms" \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
The above command returns JSON structured like this:
{
"sms": [
{
"id": "12",
"title": "ola",
"from": "labcom",
"to": "999999999",
"body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"quantity": "1",
"send_date": "2022-07-19 00:00:00",
"status": "Processing"
},
{
"id": "11",
"title": "ola",
"from": "labcom",
"to": "1",
"body": " ghshsfghfg",
"quantity": "1",
"send_date": "2022-07-19 00:00:00",
"status": "Processing"
}
],
"meta": {
"total_count": 2,
"offset": 0,
"limit": 20
}
}
This endpoint retrieves a specific sms.
curl "https://api.labcom.ao/v1/sms/12" \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
The above command returns JSON structured like this:
{
"sms": [
{
"id": "12",
"title": "ola",
"from": "labcom",
"to": "999999999",
"body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"quantity": "1",
"send_date": "2022-07-19 00:00:00",
"status": "Processing"
}
],
"meta": {
"total_count": 1,
"offset": 0,
"limit": 20
}
}
This endpoint send a Programmable SMS .
| Name | Type | Required | Description |
|---|---|---|---|
to |
Object | Required | sms recipients - can enter several separated by commas |
uniqid |
String | Required | sms id - unique id for sms to avoid sending the same sms several times |
title |
Object | Required | message title |
body |
String | Required | message content |
send_date |
String | Depends | send date. A date in the format YYYY-MM-DD (ISO 8601) and WAT timezone. |
curl -XPOST 'https://api.labcom.ao/v1/sms/send' \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
-d '{
{
"to":[
"999999999",
"923250778"
],
"uniqid": "123eq57t",
"title": "ola",
"body":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. ",
"send_date":"2022-07-20 12:02:38"
} \
The above command returns HTTP Status 200 - OK.
This endpoint deletes a sms with given Id..
curl -XDELETE "https://api.labcom.ao/v1/sms/cancel/12" \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
The above command returns HTTP Status 204 No Content.
Labcom API helps you send and manage messages programmatically.
To sens email you must specify at least an e-mail and the content.
A sms will have the following attributes
(all attributes, except custom_fields, have JSON strings as values):
This endpoint retrieves all email in the system, sorted by descending order of creation date.
curl "https://api.labcom.ao/v1/email" \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
The above command returns JSON structured like this:
{
"emails": [
{
"id": "18",
"title": "ola",
"from": "labcom",
"to": "davidmpindi@labcom.ao",
"body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim feugiat maximus.",
"quantity": "1",
"send_date": "2022-07-20 16:20:00",
"status": "Processing"
},
{
"id": "17",
"title": "ola",
"from": "labcom",
"to": "hi@labcom.ao",
"body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim feugiat maximus.",
"quantity": "1",
"send_date": "2022-07-20 16:20:00",
"status": "Processing"
}
],
"meta": {
"total_count": 2,
"offset": 0,
"limit": 20
}
}
This endpoint retrieves a specific email.
curl "https://api.labcom.ao/v1/email/18" \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
The above command returns JSON structured like this:
{
"emails": [
{
"id": "18",
"title": "ola",
"from": "labcom",
"to": "davidmpindi@labcom.ao",
"body": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim feugiat maximus.",
"quantity": "1",
"send_date": "2022-07-20 16:20:00",
"status": "Processing"
}
],
"meta": {
"total_count": 1,
"offset": 0,
"limit": 20
}
}
This endpoint send a Programmable Email .
| Name | Type | Required | Description |
|---|---|---|---|
to |
Object | Required | message recipients - can enter several separated by commas |
title |
Object | Required | message title |
cc |
Object | Depends | message cc |
bcc |
Object | Depends | message bcc |
att |
Object | Depends | message Attachment |
body |
String | Required | message content |
send_date |
String | Depends | send date. A date in the format YYYY-MM-DD (ISO 8601) and WAT timezone. |
curl -XPOST 'https://api.labcom.ao/v1/email/send' \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
-d '{
{
"to":[
"hi@labcom.ao",
"davidmpindi@labcom.ao"
],
"title": "ola",
"body":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dignissim feugiat maximus. ",
"send_date":"2022-07-20 16:20:00"
} \
The above command returns 200 - OK:
This endpoint deletes a sms with given Id..
curl -XDELETE "https://api.labcom.ao/v1/email/cancel/18" \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
The above command returns HTTP Status 204 No Content.
you can check your account balance using the following instruction:
This endpoint retrieves the balance.
curl "https://api.labcom.ao/v1/balance/" \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
The above command returns JSON structured like this:
{
"balance": {
"sms": 999,
"e-mail": 10000,
}
}
This endpoint add balance .
| Name | Type | Required | Description |
|---|---|---|---|
plan |
Object | Required |
available plans are: 1 - for Startup 2 - for Business 3 - for Enterprise |
curl -XPOST 'https://api.labcom.ao/v1/balance/add' \
-H 'Authorization: sferdfbGE47fb22eZvKYlo2Cc0fo87EHa' \
-H 'Content-Type: application/json' \
-d '{
{
"plan": "1",
} \
The above command returns JSON structured with payment data like this:
{
"entidade": "00424",
"Referencia": "030 000 522",
"Valor": "119.999,00"
}