Notification Gateway API v2020-05-30T23:36:41Z
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Notification service that can be relied upon to deliver your messages.
Base URLs:
Email: Melrose Labs - Technical Support
Authentication
- API Key (api_key)
- Parameter Name: x-api-key, in: header.
Send message
Create message
Code samples
# You can also use wget
curl -X POST https://api.melroselabs.com/notification/ \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'x-api-key: API_KEY'
const fetch = require('node-fetch');
const inputBody = '{
"account": {
"accountid": "string"
},
"options": {},
"message": {
"variants": [
{
"channel": "twitter",
"content": [
{
"ctype": "string",
"cdata": "string"
}
]
}
]
},
"recipients": [
"string"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'x-api-key':'API_KEY'
};
fetch('https://api.melroselabs.com/notification/',
{
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/notification/', 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/notification/', 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/notification/");
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/notification/',
params: {
}, headers: headers
p JSON.parse(result)
POST /
Create message.
Body parameter
{
"account": {
"accountid": "string"
},
"options": {},
"message": {
"variants": [
{
"channel": "twitter",
"content": [
{
"ctype": "string",
"cdata": "string"
}
]
}
]
},
"recipients": [
"string"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateMessage | true | none |
» account | body | object | true | none |
»» accountid | body | string | true | Account ID to use |
» options | body | object | true | none |
» message | body | object | true | Message to be sent to recipients. |
»» variants | body | [object] | false | none |
»»» channel | body | string | false | none |
»»» content | body | [CreateMessageMessageVariantsItemContentItem] | false | none |
»»»» ctype | body | string | false | Type of content |
»»»» cdata | body | string | false | Content data |
»»» recipients | body | [string] | true | none |
»»»» Destination | body | string | false | Mobile telephone number |
Enumerated Values
Parameter | Value |
---|---|
»»» channel | |
»»» channel | slack |
»»» channel |
Example responses
200 Response
{
"transactionID": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | 200 response | CreateMessageSuccess |
400 | Bad Request | 400 response | Error |
Schemas
CreateMessageSuccess
{
"transactionID": "string"
}
CreateMessageSuccess Schema
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
transactionID | string | true | none | Transaction ID for message |
Error
{
"message": "string"
}
Error Schema
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
message | string | false | none | none |
CreateMessage
{
"account": {
"accountid": "string"
},
"options": {},
"message": {
"variants": [
{
"channel": "twitter",
"content": [
{
"ctype": "string",
"cdata": "string"
}
]
}
]
},
"recipients": [
"string"
]
}
Create Message Schema
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
account | object | true | none | none |
» accountid | string | true | none | Account ID to use |
options | object | true | none | none |
message | object | true | none | Message to be sent to recipients. |
» variants | [object] | false | none | none |
»» channel | string | false | none | none |
»» content | [CreateMessageMessageVariantsItemContentItem] | false | none | none |
» recipients | [string] | true | none | none |
»» Destination | string | false | none | Mobile telephone number |
Enumerated Values
Property | Value |
---|---|
channel | |
channel | slack |
channel |
CreateMessageMessageVariantsItemContentItem
{
"ctype": "string",
"cdata": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ctype | string | false | none | Type of content |
cdata | string | false | none | Content data |