Welcome to Labcom API v1

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.


Quick Start:
1. Sign up FREE
2. Get your API key
3. send SMS

https://api.labcom.ao

API Format

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

Authentication

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.

Info! Make sure you keep your API Key a secret!.

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.


    

                                                        

    

                                                        

    

                                                        



                                                        

    

                                                        



                                                        

Errors

Erros
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.)

Send SMS

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):

Get

This endpoint retrieves all sms in the system, sorted by descending order of creation date.


HTTP Request
GET https://api.labcom.com/v1/sms



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.


HTTP Request
GET https://api.labcom.ao/v1/sms/<ID>



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

Creat

This endpoint send a Programmable SMS .


HTTP Request
POST https://api.labcom.ao/v1/sms/send

Body Request

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.


    

                                                                

    

                                                                

    

                                                                



                                                                

    

                                                                



                                                                

Cancel sms

This endpoint deletes a sms with given Id..


HTTP Request
DELETE https://api.labcom.ao/v1/sms/cancel/<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.


    

                                                                    

    

                                                                    

    

                                                                    



                                                                    

    

                                                                    



                                                                    

EMAIL

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):


Get

This endpoint retrieves all email in the system, sorted by descending order of creation date.


HTTP Request
GET https://api.labcom.com/v1/email



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.


HTTP Request
GET https://api.labcom.ao/v1/email/<ID>



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

Send

This endpoint send a Programmable Email .


HTTP Request
POST https://api.labcom.ao/v1/email/send

Body Request

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:


    

                                                                

    

                                                                

    

                                                                



                                                                

    

                                                                



                                                                

Cancel sms

This endpoint deletes a sms with given Id..


HTTP Request
DELETE https://api.labcom.ao/v1/email/cancel/<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.


    

                                                                    

    

                                                                    

    

                                                                    



                                                                    

    

                                                                    



                                                                    

Balance

you can check your account balance using the following instruction:

This endpoint retrieves the balance.


HTTP Request
GET https://api.labcom.ao/v1/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,
	}
}
                                                            

Add

This endpoint add balance .


HTTP Request
POST https://api.labcom.ao/v1/balance/add

Body Request

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"
}