Overview

TheNux’s API allows you to send text messages to TheNux’s users around the globe through simple RESTful APIs.
  • Programmatically send and receive high volume of messaging anywhere in the world.
  • Build apps that scale with the web technologies that you are already using.
  • Send message with low latency and high delivery rates.
Contents
In this document you can learn about:
Concepts
To use the TheNux API, you may need to familiarise yourself with:
  • Phone Number format - All phone numbers in the Nexmo APIs use E.164 format.
  • Authentication - TheNux API is authenticated with your account API Key.

Getting Started

Send an Message
Before you begin, Sign Up For a TheNux Account
Find your API key at thenux.com under the API section . You can now send a SMS message via:
Try it
cURL
							
curl -X "POST" 
“https://thenux.com:5281/business/broadcast" \

-d “api_key=thenux_api_key” \
-d "business_id=xxxxx" \
-d “mobile_list=+60123456789,+601245556666” \
-d “tag=*destination_tag*” \
-d “message=message_to_send”
							
						
PHP
							

<?php
	$postvars = [
		'api_key' => "YOUR_API_KEY",
		'business_id' => "YOUR_BUSINESS_ID",
		'mobile_list'   => array("phone_number_1","phone_number_2","phone_number_3"),
		'tag' => "YOUR_TAG HERE",
		'message' => "YOUR_MSG"
	];
	$url = "https://thenux.com:5281/business/broadcast";

	$ch = curl_init();
	curl_setopt($ch,CURLOPT_URL,$url);
	curl_setopt($ch,CURLOPT_POST, 1);
	curl_setopt($ch,CURLOPT_POSTFIELDS,json_encode($postvars));
	curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,3);
	curl_setopt($ch,CURLOPT_TIMEOUT, 20);
	$response = curl_exec($ch);
	curl_close ($ch);
?>
								
							
						
JAVA
							
curl -X "POST" 
“https://thenux.com:5281/business/broadcast" \

-d “api_key=thenux_api_key” \
-d "business_id=xxxxx" \

	
<?php
	$ch = curl_init();
	$postvars = [
		'api_key' => "YOUR_API_KEY",
		'business_id' => "YOUR_BUSINESS_ID",
		'mobile_list'   => array("phone_number_1","phone_number_2","phone_number_3"),
		'tag' => "YOUR_TAG HERE",
		'message' => "YOUR_MSG"
	];

	$url = "https://thenux.com:5281/business/broadcast";

	$ch = curl_init();
	curl_setopt($ch,CURLOPT_URL,$url);
	curl_setopt($ch,CURLOPT_POST, 1);                
	//0 for a get request
	curl_setopt($ch,CURLOPT_POSTFIELDS,$postvars);
	curl_setopt($ch,CURLOPT_POST, 1);
	curl_setopt($ch,CURLOPT_POSTFIELDS,json_encode($postvars));
	curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch,CURLOPT_CONNECTTIMEOUT ,3);
	curl_setopt($ch,CURLOPT_TIMEOUT, 20);
?>

private void sendMessage() throws Exception {
	String url = "https://thenux.com:5281/business/broadcast";
	URL obj = new URL(url);
	HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
}
										
									
Response
All the response will encoded with JSON.
Sample Response
{“code”: “1”, “message”: “SUCCESS”, “message_d”: “Messages sent.”, “unregistered_users”: [“+601345678”,"+6034567896"]}
Successful Response Value
Param Data Type Description Sample
code Integer Response Code 1
message String Message of the response SUCCESS
message_d String Description of the response Messages sent
result Object Results -
unregistered_users JSON string List of unregistered users ["+601345678","+6034567896"]

©2019 • TheNux.com • All Rights Reserved.