Documentation
API Requests
The Atomic reach API is a REST API. All API requests are sent to
api.atomicreach.com. Arguments are sent via GET parameters.At minimum the
methodparameter is always required.Here is an example request:
http://api.atomicreach.com/?method=tribes.getPosts&tribeId={tribeId}See the API Methods for more details on what methods are available and which arguments each method requires.
API Response
All responses are encoded UTF-8.
Each request will be returned in an response envelope always containing two parts:
- meta
status: which will respond withokorfail
message: information on why the request failed.- rsp
- Actual response from the request
Formats
Each request can have its request sent in various formats. This can be specified by adding a
formatparameter to the request, If not specified, the response will be returned injsonformat.- test
- This returns the response in a human readable format with additional information of datatypes. (Content-Type: text/plain;)
This format should not be used in production development - json
- This returns the response in a json object (Content-Type: text/json;)
- phpSerial
- This returns the response in a serialized PHP string. This can be decoded in PHP using the
unserializemethod.(Content-Type: text/plain;)
Decoding Atomic Reach data inside a canvas iframe
If you are developing in a canvas URL on the Atomic domain, you can get information about the logged in user via the
ardatapost parameter.You can decrypt the data using the the following method. Pass the Post value, and you application secret, to return a json string.
function arDecode($user_data,$secret) {
$user_json = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $secret, base64_decode($user_data), MCRYPT_MODE_ECB, mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB), MCRYPT_RAND)));
return json_decode($user_json);
}Values include user's Id and username
Roadmap
Items that need to be added.
- Enchanced documentation
- Sample Application
- posts.search - Date range
- posts.search - Count results
- Code Libraries