Skip to content
Branch: master
Find file History
mikezm mm - 100418 - fixed parameter name
rm_mailingsGroupsModify parameter referred incorrectly to $request_id instead of $RequestBody
Latest commit 19c174e Oct 4, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Updated setting of curl options and adjusted May 28, 2014
rmapi.class.php mm - 100418 - fixed parameter name Oct 4, 2018

ReachMail API client library for php

rmapi.class.php aims to provide a simple client library for interacing with the ReachMail API.


Getting started

This php module is a simple client library with convenience functions for all of the ReachMail API services.

Similarly to the API itself it is geared toward those with at least intermediate programming ability.

Note that at this time the client library supports only token authentication. For more information, refer to these instructions on creating a token.


There's no specific installation process for this library. Simply place it in a directory of your choosing, making sure that the directory is accessible to all who need to access the library.

    install -m 0750 rmapi.class.php /usr/share/php5/rmapi.class.php


To use this library, use the PHP function include_once() to add the library functions to your script. Then create a new library object with your API token.

    $rmapi = new RMAPI('your-api-token');

Once your library object has been created, individual services can be called using the various convenience functions.

    $account_info = $rmapi->rm_administrationUsersCurrent();

Function parameters and return values:

Some functions will require that you submit parameters. These parameters may be URI parameters or a request body for POST and PUT services. In the case of POST and PUT services, the request body should always be submitted as RequestBody. URI parameter names match the names detailed in the service documentation.

For example, the campaigns service used to schedule mailings requires the URI parameter AccountId and a RequestBody. The RequestBody variable should be a PHP object capabale of being converted to JSON via json_encode. The service would be called as follows.

    $campaign = $rmapi->rm_campaigns($AccountId=$id,

All functions return the HTTP status code and the service response in an array. The service response will be a PHP object derived from the JSON response using json_decode.

        [http_status] => 200
        [service_response] => stdClass Object
                [Id] => "xxxxxxx-xxx-xxx-xxxx-xxxxxxxxx"

Questions regarding use of this software should be refered to

You can’t perform that action at this time.