API REFERENCE GUIDE

to get started  introduction

AuverCloud API server

REST based server

The AuverCloud API server is a simple REST based server which provides application and web designers with cloud based services and utilities.

POST, GET

AuverCloud API server only uses the two following HTTP methods: GET and POST. Any call attempt using an other method is rejected with an error message.

Single URL

Whatever the service called, a single server address is used: .

Response format: JSON

In most cases, the server response format is JSON. For instance, calling the API server with no parameter returns the following response:

{
	"code":"602",
	"msg":"API ID is missing.",
	"data":""
}

The AuverCloud JSON response has always the same structure:

  • code is the response code. Its nominal value is "200", otherwise it is an error code. See the common errors section for generic API server errors. Otherwise, specific errors are described for each individual API.
  • msg is the response message. Its nominal value is "OK", otherwise it is a short error message.
  • data is the response itself and depends on each individual API.

PLEASE NOTE: For content related API, the default format is not JSON but HTML, XML or PNG. See details in content_log, content_pub, content_rss and qr.

API parameters

Even if API parameters vary from one service to another, there are some common elements:

API/Service ID

All services are defined by their API/Service ID using the parameter named api and a value such as "content_pub", "qr" or "version".

Application key

Most of API require an Application Key using the parameter named key and a value which should look like the following code "c54e7837e0cd0ced286cb5995327d1ab54e35987179b2" (test key only!).

Application Keys can be obtained from the appropriate section of AuverCloud Studio where you can generate as many keys as you want for your various web sites and applications.

PLEASE NOTE: In AuverCloud Studio, pay attention to the various properties of application keys which define their proper operation and safety mode.

The only API which is anonymous (no application key required) is callback.

Application secret

Few services require an Application Secret in addition to the Application Key. The parameter name is secret and its value should look like the following code "thisisasecretcode1a6525f6d0e753738f9f6b9".

For example, see stat_api.

Session parameters

Some API require a user session which can be established with the API signin that returns an associative array composed of 4 parameters.

  • uuid: A Unique User ID (string)
  • usid: A Unique Session ID (string)
  • udid: A Unique Device ID (string), either the default server value or the optional parameter fingerprint.
  • eost: The End of Session Time (integer) is expressed as Unix Epoch time.

These values must be stored on client side for any further session based API call. See the API signed and the API client for further information about sessions and session based API calls.

Your first API calls

The simplest call

Why not starting with the version API that returns the server version:

{
	"code":"200",
	"msg":"OK",
	"data":"version 3.1"
}

Going further: Playing with the test bed

Each API description contains a test bed section prefilled with a demo key an usuals parameters. Do not hesitate to play with this tool using your own keys and parameters.

The next API client section is about the JavaScript and PHP client libraries proposed by AuverCloud to ease the integration of API calls in web pages and applications. Examples of API calls using these libraries are presented in each API description section.