Table of Contents

INTRODUCTION

Welcome back my valued viewers,

You will learn how to leverage the API Key of 1Byte SMS Service and how to integrate this amazing key into your application, program, or whatever else you desire in this tutorial from 1Byte.

Intergrate 1Byte SMS Service in your app is simple

WHAT IS API KEY?

+ To save the post from getting too long and to appeal to people who are unfamiliar with IT knowledge, I will describe it as simply as possible.

+ Assume you’ve recently launched an application that you developed yourself. You now want your application to be able to deliver bulk SMS messages. But you have no idea how to code and implement this functionality.
→ Your solution is find a way to intergrate 1Byte SMS service into your application.

+ Because the presence of 1Byte API Key, you now may utilize API Key integrated into your own applications.
→ As a result, you don’t need to utilize the 1Byte platform to send SMS messages (login into 1Byte account, sending SMS from 1Byte site); instead, your application may use the built-in 1Byte SMS service functionality.

PREREQUISITES

1) You need to have a cool-sounding Brandname

If you don’t have a BrandName yet, see the instructions for creating a BrandName from 1Byte.

2) You need to have API Key

→ Select API Key Management from the User Dashboard page. You’ll find the SMS API Key there.

INTERGRATE 1BYTE SMS SERVICE IN YOUR APP IS SIMPLE
1Byte SMS API Key

3) A list of receivers in JSON format, nomarlly this list comes with 3 main fields of information: Name, Phone Number and Date of Birth.

→ You can use Convertio to convert from excel to JSON format

GENERAL INFO

+ 1Byte’s API only work on HTTPS protocol

→ No one can spoofing your message content

+ Limit API calls to 100 times per minute. 

→ The objective of this is to prevent evil actors from exploiting and bruteforcing API Key

+ API response data will be in JSON format

+ The APIs will respond with the following appropriate HTTP status code

API STATUS CODE
HTTP Code 200 4XX 5XX
Explanation - Send SMS Successfully - Your balance is insufficient
- Invalid Brandname
- ...etc
- Internal Server Errors
- ...etc

+ API Send SMS

API SEND SMS
Description API Send SMS
URL {{API_BASE_URL}}/external/sms
Method POST
Authorization API Key
Body JSON
				
					{
	{
		"timezone": "string",
		"brandName": "string",
		"subject": "string",
		"content": "string",
		"type": "NOW",
		"sendingTime": "2022-02-14T08:10:26.730Z",
		"sendBefore": {
			"day": 0,
			"at": "string"
		},
		"listUser": [
			{
				"birthday": "string",
				"name": "string",
				"phoneNumber": "string"
			}
		]
	}
	}
				
			
  • Success Response
    • Code: 200
    • Content
				
					{
  "messageCode": "SEND_SMS_SUCCESSFUL",
  "message": "Your request has been to queue"
}
				
			
  • Error Response
    • Code: `404
    • Content
				
					{
 "statusCode": 404,
 "message": string ,
 "messageCode": string
}
				
			
  • Error Response
    • Code: `400
    • Content
				
					{
 "statusCode": 400,
 "message": [],
 "error": string
}
				
			

+BODY

  • brandName: (Obligatory) SMS Brandname.
  • subject: (Obligatory)the header of the SMS command.
  • content: (Obligatory) SMS content sent to the recipient.
  • type: (Obligatory) accepts only the following values:
    • NOW: sent immediately.
    • BIRTHDAY: sent by date of birth.
    • TIMER: sent at a future date.
  • sendingTime: (required when type is TIME) Datetime type with ISO 8601 format.
  • timezone: (required when type is BIRTHDAY) time zone of the message recipient. See a list of time zones here.
  • sendBefore: (required when type is BIRTHDAY) includes two values:
    • day: (Obligatory) indicates how many days before the recipient’s birthday the message was sent. Up to 7 days.
    • at: (Obligatory) time to send the message. 24-hour format HH:ss
  • listUser: (Obligatory) message recipient list. Each recipient contains the following information:
  • name: (Obligatory) Recipient’s name
  • phoneNumber: (Obligatory) phone number, starting with +855
  • birthday: (required when type is BIRTHDAY) date of birth, format dd/mm/yyyy

STEP BY STEP

+ Step 1: Using POST request, and this POST request will be sent to this URL:

https://api.1byte.com/external/sms

+ Step 2: Putting your API Key into Headers section of POST request

INTERGRATE 1BYTE SMS SERVICE IN YOUR APP IS SIMPLE
API Key must be used in Headers section of POST request

+ Step 3: Putting your SMS messages (data) as raw + JSON format in Body section of POST request

INTERGRATE 1BYTE SMS SERVICE IN YOUR APP IS SIMPLE
Follow the instruction of the image

NOTE: Please remove all comment in your SMS messages

SMS DATA (JSON FORMAT)

Case 1: Send Type Is "Now" (Send Immediately)

				
					//This is the HEADER section of POST request
X-API-KEY: 1ce8ac553ab0559xxxxxxxxxf61a     //insert your SMS API KEY here
				
			
				
					//This is the BODY section of POST request
{
  "brandName": "1Byte-Demo",              //insert your SMS Brandname in here
  "subject": "Warning about COVID-19 ",   //insert your SMS title in here
  "content": "Require all employees of company A to wear masks when working ", //insert your SMS content in here
  "type": "NOW",
  "listUser": [
    {
      "name": "Person A",                 //insert your customer name in here
      "phoneNumber": "+855123123123"      //insert your customer phone in here
    },
    {
      "name": "Person B",                 //insert your customer name in here
      "phoneNumber": "+855123456789"      //insert your customer phone in here
    }
  ]
}
				
			

Case 2: Send Type Is "Birthday" (Send Based On Birthday)

				
					//This is the HEADER section of POST request
X-API-KEY: 1ce8ac553ab0559xxxxxxxxxf61a     //insert your SMS API KEY here
				
			
				
					{
  "brandName": "1Byte-Demo",          //insert your SMS Brandname in here
  "subject": "Happy Brithday",        //insert your SMS title in here
  "content": "1Byte would like to wish you happy brithday!!!",   //insert your SMS content in here
  "type": "BIRTHDAY",
  "timezone": "Asia/Phnom_Penh",
  "sendBefore": {
    "day": 0,                           //From the date of birth of the recipient, send 0 days before  
    "at": "24:00"                       //Send at 24:00 (midnight - 12PM) 
  },
  "listUser": [
    {
      "name": "Person A",               //insert your customer name in here
      "phoneNumber": "+855123123123",   //insert your customer phone in here
      "birthday": "22/02/1992"          //insert your customer DOB in here
    },
    {
      "name": "Person B",
      "phoneNumber": "+855123456789",
      "birthday": "22/02/1992"
    }
  ]
}'
				
			

Case 3: Send Type Is "Timer" (Send Based On A Certain Day In Future)

				
					//This is the HEADER section of POST request
X-API-KEY: 1ce8ac553ab0559xxxxxxxxxf61a     //insert your SMS API KEY here
				
			
				
					//This is the BODY section of POST request
{
  "brandName": "1Byte-Demo",            //insert your SMS Brandname in here
  "subject": "Change of workplace",     //insert your SMS title in here
  "content": "We will no longer work here, but will move to Building B instead ",
  "type": "TIMER",
  "sendingTime": "2022-02-22T08:00:00.000Z",   //will be send on 22-Feb-2022 at 8AM 
  "listUser": [
    {
      "name": "Person A",                 //insert your customer name in here
      "phoneNumber": "+855123123123"      //insert your customer phone in here
    },
    {
      "name": "Person B",
      "phoneNumber": "+855123456789"
    }
  ]
}'
				
			

CONCLUSION

+ Congratulations, you’ve made it this far; now you know how to integrate 1Byte’s API Key into your site or application without actually logging into 1Byte’s site

+ If you have any more concerns or need assistance, you can reach out to 1Byte’s LiveChat customer support at any time.

MORE REFERENCES

+ To get the latest promotions, events. Please check out this link

+ To get the fastest answer, the FAQ Page is the best place to look for

+ Keep up with 1Byte’s YouTube channel to make it simpler to comprehend

+ As always, 1Byte would bring you fresh content and exclusive deals in the future. STAY TUNED!!!

JOINT OUR GROWING FAMILY