NAV Navbar
cURL Node.js Python PHP Java Ruby

SMS API v2019-07-27T08:49:36Z

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

The REST SMS API is used for sending, receiving and managing SMS between application and mobile devices. Phonebooks and distribution lists are also available. All dates/timestamps are in ISO 8601 format. API keys for including as the x-api-key header in requests can be obtained at https://melroselabs.com. This SMS API can be used in conjunction with the Tyr SMS Gateway and the SMPP SMS Gateway from Melrose Labs.

Base URLs:

Email: Melrose Labs - Technical Support

Authentication

Distribution lists

Create list

Code samples

# You can also use wget
curl -X POST https://api.melroselabs.com/sms/directory/distributionlist \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/directory/distributionlist',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.melroselabs.com/sms/directory/distributionlist', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.melroselabs.com/sms/directory/distributionlist', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/directory/distributionlist");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.melroselabs.com/sms/directory/distributionlist',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /directory/distributionlist

Create a distribution list

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Add person

Code samples

# You can also use wget
curl -X POST https://api.melroselabs.com/sms/directory/distributionlist/{list} \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/directory/distributionlist/{list}',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.melroselabs.com/sms/directory/distributionlist/{list}', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.melroselabs.com/sms/directory/distributionlist/{list}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/directory/distributionlist/{list}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.melroselabs.com/sms/directory/distributionlist/{list}',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /directory/distributionlist/{list}

Add person to a distribution list

Parameters

Name In Type Required Description
list path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Delete list

Code samples

# You can also use wget
curl -X DELETE https://api.melroselabs.com/sms/directory/distributionlist/{list} \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/directory/distributionlist/{list}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.delete('https://api.melroselabs.com/sms/directory/distributionlist/{list}', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.melroselabs.com/sms/directory/distributionlist/{list}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/directory/distributionlist/{list}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.melroselabs.com/sms/directory/distributionlist/{list}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /directory/distributionlist/{list}

Delete a distribution list

Parameters

Name In Type Required Description
list path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Send message to list

Code samples

# You can also use wget
curl -X POST https://api.melroselabs.com/sms/directory/distributionlist/{list}/message \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/directory/distributionlist/{list}/message',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.melroselabs.com/sms/directory/distributionlist/{list}/message', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.melroselabs.com/sms/directory/distributionlist/{list}/message', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/directory/distributionlist/{list}/message");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.melroselabs.com/sms/directory/distributionlist/{list}/message',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /directory/distributionlist/{list}/message

Send a message to distribution list members

Parameters

Name In Type Required Description
list path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Delete person

Code samples

# You can also use wget
curl -X DELETE https://api.melroselabs.com/sms/directory/distributionlist/{list}/{person} \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/directory/distributionlist/{list}/{person}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.delete('https://api.melroselabs.com/sms/directory/distributionlist/{list}/{person}', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.melroselabs.com/sms/directory/distributionlist/{list}/{person}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/directory/distributionlist/{list}/{person}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.melroselabs.com/sms/directory/distributionlist/{list}/{person}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /directory/distributionlist/{list}/{person}

Delete person from a distribution list

Parameters

Name In Type Required Description
list path string true none
person path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Phonebooks

Create phonebook

Code samples

# You can also use wget
curl -X POST https://api.melroselabs.com/sms/directory/phonebook \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/directory/phonebook',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.melroselabs.com/sms/directory/phonebook', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.melroselabs.com/sms/directory/phonebook', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/directory/phonebook");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.melroselabs.com/sms/directory/phonebook',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /directory/phonebook

Create a phonebook

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Add person

Code samples

# You can also use wget
curl -X POST https://api.melroselabs.com/sms/directory/phonebook/{phonebook} \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/directory/phonebook/{phonebook}',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.melroselabs.com/sms/directory/phonebook/{phonebook}', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.melroselabs.com/sms/directory/phonebook/{phonebook}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/directory/phonebook/{phonebook}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.melroselabs.com/sms/directory/phonebook/{phonebook}',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /directory/phonebook/{phonebook}

Add person to phonebook

Parameters

Name In Type Required Description
phonebook path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Delete phonebook

Code samples

# You can also use wget
curl -X DELETE https://api.melroselabs.com/sms/directory/phonebook/{phonebook} \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/directory/phonebook/{phonebook}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.delete('https://api.melroselabs.com/sms/directory/phonebook/{phonebook}', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.melroselabs.com/sms/directory/phonebook/{phonebook}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/directory/phonebook/{phonebook}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.melroselabs.com/sms/directory/phonebook/{phonebook}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /directory/phonebook/{phonebook}

Delete a phonebook

Parameters

Name In Type Required Description
phonebook path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Delete person

Code samples

# You can also use wget
curl -X DELETE https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person} \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.delete('https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /directory/phonebook/{phonebook}/{person}

Delete person from phonebook

Parameters

Name In Type Required Description
person path string true none
phonebook path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Send message to person

Code samples

# You can also use wget
curl -X POST https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}/message \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}/message',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}/message', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}/message', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}/message");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.melroselabs.com/sms/directory/phonebook/{phonebook}/{person}/message',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /directory/phonebook/{phonebook}/{person}/message

Send a message to a person in the phonebook.

Parameters

Name In Type Required Description
person path string true Identifier of person
phonebook path string true Identifier of phonebook

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Message

Send message

Code samples

# You can also use wget
curl -X POST https://api.melroselabs.com/sms/message \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');
const inputBody = '{
  "source": "string",
  "destination": "string",
  "message": "string",
  "receipt": true,
  "receiptURL": "string",
  "validity": "2020-08-15T22:54:16Z",
  "validityMinutes": "string",
  "scheduled": "2020-08-15T22:54:16Z"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/message',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.melroselabs.com/sms/message', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.melroselabs.com/sms/message', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/message");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.melroselabs.com/sms/message',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /message

Send a message or messages. Also used to submit a message for scheduled delivery at a later time.

Body parameter

{
  "source": "string",
  "destination": "string",
  "message": "string",
  "receipt": true,
  "receiptURL": "string",
  "validity": "2020-08-15T22:54:16Z",
  "validityMinutes": "string",
  "scheduled": "2020-08-15T22:54:16Z"
}

Parameters

Name In Type Required Description
body body SendMessage true Message to be sent
» source body string true Origin mobile number or alphatag.
» destination body string true Target mobile number to where the message is being sent.
» message body string true Message text to be sent via SMS to a destination mobile. If longer than a single SMS the a long SMS (comprising more than a single SMS) will be sent.
» receipt body boolean false Delivery receipt requested. Receipt will be sent to default URL if receiptURL not provided.
» receiptURL body string false Callback URL for delivery receipt on completion of message.
» validity body string(date-time) false Time when the message expires, in ISO 8601 format.
» validityMinutes body string(integer) false Number of minutes until message should expire. Instead of validity.
» scheduled body string(date-time) false Time when delivery of the message will be attempted, in ISO 8601 format.

Example responses

200 Response

{
  "transactionID": "string"
}

Responses

Status Meaning Description Schema
200 OK Message successfully submitted SubmitResponse
400 Bad Request Failure to submit message Error

Get message status

Code samples

# You can also use wget
curl -X GET https://api.melroselabs.com/sms/message/{transactionid} \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/message/{transactionid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.get('https://api.melroselabs.com/sms/message/{transactionid}', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.melroselabs.com/sms/message/{transactionid}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/message/{transactionid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.get 'https://api.melroselabs.com/sms/message/{transactionid}',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /message/{transactionid}

Get the status of a previously submitted message or messages.

Parameters

Name In Type Required Description
transactionid path string true none

Example responses

200 Response

{
  "transactionID": "string",
  "status": {
    "text": "scheduled",
    "value": 0
  },
  "completion": "2020-08-15T22:54:16Z",
  "validity": "2020-08-15T22:54:16Z",
  "scheduled": "2020-08-15T22:54:16Z",
  "receipt_timestamp": "2020-08-15T22:54:16Z"
}

Responses

Status Meaning Description Schema
200 OK Successful status query StatusModel
400 Bad Request Unsuccessful status query Error

Update message

Code samples

# You can also use wget
curl -X PUT https://api.melroselabs.com/sms/message/{transactionid} \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/message/{transactionid}',
{
  method: 'PUT',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.put('https://api.melroselabs.com/sms/message/{transactionid}', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.melroselabs.com/sms/message/{transactionid}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/message/{transactionid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.put 'https://api.melroselabs.com/sms/message/{transactionid}',
  params: {
  }, headers: headers

p JSON.parse(result)

PUT /message/{transactionid}

Update a previously submitted message that has not yet been delivered.

Parameters

Name In Type Required Description
transactionid path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Delete message

Code samples

# You can also use wget
curl -X DELETE https://api.melroselabs.com/sms/message/{transactionid} \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/message/{transactionid}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.delete('https://api.melroselabs.com/sms/message/{transactionid}', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.melroselabs.com/sms/message/{transactionid}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/message/{transactionid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.melroselabs.com/sms/message/{transactionid}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /message/{transactionid}

Delete a previously submitted message or messages

Parameters

Name In Type Required Description
transactionid path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK Message successfully deleted Empty

VMNs

List allocated VMNs

Code samples

# You can also use wget
curl -X GET https://api.melroselabs.com/sms/vmn \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/vmn',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.get('https://api.melroselabs.com/sms/vmn', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.melroselabs.com/sms/vmn', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/vmn");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.get 'https://api.melroselabs.com/sms/vmn',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /vmn

Get list of allocated VMNs

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Allocate VMN

Code samples

# You can also use wget
curl -X POST https://api.melroselabs.com/sms/vmn \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');
const inputBody = '{
  "country": "string",
  "network": "string",
  "msisdn": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/vmn',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.melroselabs.com/sms/vmn', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.melroselabs.com/sms/vmn', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/vmn");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.melroselabs.com/sms/vmn',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /vmn

Allocate a Virtual Mobile Number to your account.

Body parameter

{
  "country": "string",
  "network": "string",
  "msisdn": "string"
}

Parameters

Name In Type Required Description
body body VMNRequest true VMN request
» country body string false Requested country
» network body string false Requested network
» msisdn body string false Requested mobile number

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK Successful allocation of VMN Empty
400 Bad Request Unsuccessful allocation of VMN Error

Release VMN

Code samples

# You can also use wget
curl -X DELETE https://api.melroselabs.com/sms/vmn \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');
const inputBody = '{
  "vmn": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/vmn',
{
  method: 'DELETE',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.delete('https://api.melroselabs.com/sms/vmn', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.melroselabs.com/sms/vmn', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/vmn");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.melroselabs.com/sms/vmn',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /vmn

Release a Virtual Mobile Number from your account.

Body parameter

{
  "vmn": "string"
}

Parameters

Name In Type Required Description
body body VMN true VMN to be deleted
» vmn body string true Virtual Mobile Number MSISDN

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK Successful release of VMN Empty
400 Bad Request Unsucessful release of VMN Error

List available VMNs

Code samples

# You can also use wget
curl -X GET https://api.melroselabs.com/sms/vmn/available \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');
const inputBody = '{
  "country": "string",
  "network": "string",
  "msisdn": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/vmn/available',
{
  method: 'GET',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.get('https://api.melroselabs.com/sms/vmn/available', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.melroselabs.com/sms/vmn/available', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/vmn/available");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.get 'https://api.melroselabs.com/sms/vmn/available',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /vmn/available

Get list of VMNs available

Body parameter

{
  "country": "string",
  "network": "string",
  "msisdn": "string"
}

Parameters

Name In Type Required Description
body body VMNRequest true VMNs of interest
» country body string false Requested country
» network body string false Requested network
» msisdn body string false Requested mobile number

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK Successful operation Empty
400 Bad Request Unsuccessful operation Error

Get VMN callback URL

Code samples

# You can also use wget
curl -X GET https://api.melroselabs.com/sms/vmn/callbackurl \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/vmn/callbackurl',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.get('https://api.melroselabs.com/sms/vmn/callbackurl', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.melroselabs.com/sms/vmn/callbackurl', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/vmn/callbackurl");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.get 'https://api.melroselabs.com/sms/vmn/callbackurl',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /vmn/callbackurl

Get the callback URL for a VMN

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Set VMN callback URL

Code samples

# You can also use wget
curl -X POST https://api.melroselabs.com/sms/vmn/callbackurl \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/vmn/callbackurl',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.post('https://api.melroselabs.com/sms/vmn/callbackurl', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://api.melroselabs.com/sms/vmn/callbackurl', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/vmn/callbackurl");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.post 'https://api.melroselabs.com/sms/vmn/callbackurl',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /vmn/callbackurl

Set the vallback URL for a VMN

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK Successful allocation of VMN Empty

Update VMN callback URL

Code samples

# You can also use wget
curl -X PUT https://api.melroselabs.com/sms/vmn/callbackurl \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/vmn/callbackurl',
{
  method: 'PUT',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.put('https://api.melroselabs.com/sms/vmn/callbackurl', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PUT','https://api.melroselabs.com/sms/vmn/callbackurl', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/vmn/callbackurl");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.put 'https://api.melroselabs.com/sms/vmn/callbackurl',
  params: {
  }, headers: headers

p JSON.parse(result)

PUT /vmn/callbackurl

Update callback URL for a VMN

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Delete VMN callback URL

Code samples

# You can also use wget
curl -X DELETE https://api.melroselabs.com/sms/vmn/callbackurl \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/vmn/callbackurl',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.delete('https://api.melroselabs.com/sms/vmn/callbackurl', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://api.melroselabs.com/sms/vmn/callbackurl', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/vmn/callbackurl");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.delete 'https://api.melroselabs.com/sms/vmn/callbackurl',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /vmn/callbackurl

Delete callback URL for a VMN

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK Successful release of VMN Empty

Get inbound message (specific)

Code samples

# You can also use wget
curl -X GET https://api.melroselabs.com/sms/vmn/queue/{vmn} \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/vmn/queue/{vmn}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.get('https://api.melroselabs.com/sms/vmn/queue/{vmn}', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.melroselabs.com/sms/vmn/queue/{vmn}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/vmn/queue/{vmn}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.get 'https://api.melroselabs.com/sms/vmn/queue/{vmn}',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /vmn/queue/{vmn}

Get the next inbound message for a VMN

Parameters

Name In Type Required Description
vmn path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Get number of message for VMN

Code samples

# You can also use wget
curl -X GET https://api.melroselabs.com/sms/vmn/queue/{vmn}/size \
  -H 'Accept: application/json' \
  -H 'x-api-key: API_KEY'

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'x-api-key':'API_KEY'

};

fetch('https://api.melroselabs.com/sms/vmn/queue/{vmn}/size',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Accept': 'application/json',
  'x-api-key': 'API_KEY'
}

r = requests.get('https://api.melroselabs.com/sms/vmn/queue/{vmn}/size', params={

}, headers = headers)

print r.json()

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'x-api-key' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','https://api.melroselabs.com/sms/vmn/queue/{vmn}/size', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

URL obj = new URL("https://api.melroselabs.com/sms/vmn/queue/{vmn}/size");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'x-api-key' => 'API_KEY'
}

result = RestClient.get 'https://api.melroselabs.com/sms/vmn/queue/{vmn}/size',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /vmn/queue/{vmn}/size

Get the numbers of messages in the queue for a VMN

Parameters

Name In Type Required Description
vmn path string true none

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Schemas

Empty

{}

Empty Schema

Properties

None

VMN

{
  "vmn": "string"
}

VMN Schema

Properties

Name Type Required Restrictions Description
vmn string true none Virtual Mobile Number MSISDN

SubmitResponse

{
  "transactionID": "string"
}

Error Schema

Properties

Name Type Required Restrictions Description
transactionID string false none ID that identifies the message submitted in the transaction

Error

{
  "message": "string"
}

Error Schema

Properties

Name Type Required Restrictions Description
message string false none none

StatusModel

{
  "transactionID": "string",
  "status": {
    "text": "scheduled",
    "value": 0
  },
  "completion": "2020-08-15T22:54:16Z",
  "validity": "2020-08-15T22:54:16Z",
  "scheduled": "2020-08-15T22:54:16Z",
  "receipt_timestamp": "2020-08-15T22:54:16Z"
}

SendMessage Schema

Properties

Name Type Required Restrictions Description
transactionID string true none Identifier of the previous transaction that is to be updated.
status object false none Status of the message submission
» text string false none Status of the message submission as a text string
» value number false none Status of the message submission as a number
completion string(date-time) false none Time when the message completed (i.e. reached a final state), in ISO 8601 format.
validity string(date-time) false none Time when the message expires, in ISO 8601 format.
scheduled string(date-time) false none Time when delivery of the message will be attempted, in ISO 8601 format.
receipt_timestamp string(date-time) false none Time when delivery receipt was successfully transmitted to callback URL, in ISO 8601 format.

Enumerated Values

Property Value
text scheduled
text enroute
text delivered
text expired
text undeliverable
text cancelled
text deleted

VMNRequest

{
  "country": "string",
  "network": "string",
  "msisdn": "string"
}

VMNRequest Schema

Properties

Name Type Required Restrictions Description
country string false none Requested country
network string false none Requested network
msisdn string false none Requested mobile number

SendMessage

{
  "source": "string",
  "destination": "string",
  "message": "string",
  "receipt": true,
  "receiptURL": "string",
  "validity": "2020-08-15T22:54:16Z",
  "validityMinutes": "string",
  "scheduled": "2020-08-15T22:54:16Z"
}

SendMessage Schema

Properties

Name Type Required Restrictions Description
source string true none Origin mobile number or alphatag.
destination string true none Target mobile number to where the message is being sent.
message string true none Message text to be sent via SMS to a destination mobile. If longer than a single SMS the a long SMS (comprising more than a single SMS) will be sent.
receipt boolean false none Delivery receipt requested. Receipt will be sent to default URL if receiptURL not provided.
receiptURL string false none Callback URL for delivery receipt on completion of message.
validity string(date-time) false none Time when the message expires, in ISO 8601 format.
validityMinutes string(integer) false none Number of minutes until message should expire. Instead of validity.
scheduled string(date-time) false none Time when delivery of the message will be attempted, in ISO 8601 format.