NAV Navbar
cURL PHP Java Ruby Python

Rich Messaging API v2019-07-25T17:15:56Z

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 Rich Messaging API is used for sending rich content messages to mobiles as part of the Rich Messaging service.

Base URLs:

Email: Melrose Labs - Technical Support

Authentication

Messages

Send message

Code samples

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

<?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/richmessaging/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/richmessaging/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/richmessaging/message',
  params: {
  }, headers: headers

p JSON.parse(result)

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

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

}, headers = headers)

print r.json()

POST /message

Send a Rich Message to a mobile

Example responses

200 Response

{}

Responses

Status Meaning Description Schema
200 OK 200 response Empty

Schemas

Empty

{}

Empty Schema

Properties

None