Getting Started


Reefware API Overview

The Reefware API allows developers a simple way to connect and request information from the Reefware server. Each request to the server requires an API Key for authentication.


API Key

The API Key is automatically created when a Reefware account is created. You can locate this key by signing into your account, hovering over the "Account" link in the top menu, and selecting API.

Your API Key will look similar to:

aaef6b1927353fa14225a74eb7a60aa0ddd497xz

You also have the ability to generate a new API Key from this section of your account.

Access Account API


API Authentication

Each API request must be authenticated with the API Key from above. The API Key will need to be sent by an HTTP Header Request.

('Authentication: aaef6b1927353fa14225a74eb7a60aa0fcc497xz')

Example:

PHP

  1. $url = 'http://www.reefware.com/api/request/v1/account';
  2. $ch = curl_init($url);
  3. $options = array(
  4. CURLOPT_RETURNTRANSFER => true,
  5. CURLOPT_HTTPHEADER => array(
  6. 'Authentication: aaef6b1927353fa14225a74eb7a60aa0fcc497xz'
  7. ),
  8. );
  9. curl_setopt_array( $ch, $options );
  10. $result = curl_exec($ch);
  11. curl_close($ch);

URL Structure

Along with passing the API Key for Authentication you will need to pass a url to get specific data from the Reefware server.

The url consists of a few main parts: base url, version number, method, and options.

Base Url
required

The base url will always be:

http://www.reefware.com/api/request

Version Number
required

The current version is v1.

The url will now look like:

http://www.reefware.com/api/request/v1

Method
required

The method will return a specific set of data that relates to your Reefware account.

The available methods are Account, Default, Controller, Notification, Tank, Livestock, Parameter, Calendar, Expense, Evaporation, and Media.

The url will now look similar to:

http://www.reefware.com/api/request/v1/livestock

Options
optional

Instead of requesting all information about a specific method you can use Options to narrow your results.

The available options are Data, Tank, Format, Limit, Offset, and Suppress.

The url will now look similar to:

http://www.reefware.com/api/request/v1/livestock/data/name.size/format/json

The Tank Option is only required for the Evaporation and Media Methods.

Read API Reference