addMessage - add new message

URL - /api/resellers/addMessage

It is required to send all messages on this link. You can block all incoming SMS containing confidential information such as SMS with credentials of private account on mobile operator's site and other SMS.

Example

  • javascript
// Axios JS
axios.post(
  'http://_SERVER_URL_/api/resellers/addMessage', 
  {
    date: "1546934787",
    number: "+234112233445",// or id: 10(id from sendNumbersOnline)
    from: "VKcom",  
    message: "VKcom 111111"
  },
  {headers: {Authorization: 'Bearer APIKEY', 'Content-Type': 'application/json; charset=utf-8'}}
)
  • python
# Install the Python Requests library: `pip install requests`
import requests
import json

def send_request():
    try:
        response = requests.post(
            url="http://_SERVER_URL_/api/resellers/addMessage",
            headers={"Authorization": "Bearer APIKEY","Content-Type": "application/json; charset=utf-8"},
            data=json.dumps({"date": "1546934787","number": "+234112233445","message": "VKcom 111111","from": "VKcom"})
        )
        print('Response HTTP Status Code: {status_code}'.format(status_code=response.status_code))
        print('Response HTTP Response Body: {content}'.format(content=response.content))
    except requests.exceptions.RequestException:
        print('HTTP Request failed')
  • php
<?php
//php
// Include Guzzle. If using Composer: require 'vendor/autoload.php';
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;

$client = new Client();
$response = (new Client())->send(new Request(
      'POST',
      'http://_SERVER_URL_/api/resellers/addMessage',
      ['Authorization' => 'Bearer APIKEY','Content-Type' => 'application/json; charset=utf-8'],
      json_encode(['number'=>'+234112233445','from'=>'VKcom','message'=>'VKcom 111111','date'=>'1546934787'])
));
echo 'Response HTTP : ' . $response->getStatusCode();
  • cURL
curl 
    -X "POST" "http://_SERVER_URL_/api/resellers/addMessage" \
    -H 'Authorization: Bearer APIKEY' \
    -H 'Content-Type: application/json; charset=utf-8' \
    -d '{ "date": "1546934787", "number": "+234112233445", "message": "VKcom 111111", "from": "VKcom"}'

Parameters

Parameter name Parameter Data type Description
number required TEXT Phone number
Format: International
Example: 234112233445
from required TEXT Message sender
message required TEXT Message contents
date required TEXT Message received date.
Format: Timestamp
Example: 1543917600
test optional string Parameter for this method, if === 'test1', data will not be saved. If === 'test2', prints the request

Result

After successful execution of the request you will get the JSON format response like this:

json {response:RESPONSE}

Result Description
response 1, if request was successful, or reports an error

ERRORS

Status Result Description
400 NO_NUMBER Number is missing
400 ERROR_PARAMS Number or ID is missing in request
400 NUMBER_FORMAT_ERROR Number format error