Climaps API  version 1
Static Public Member Functions | List of all members
credits Class Reference

Static Public Member Functions

static getOwnCredits ()
 
static getOwnTransactions ()
 
static getTransactionTypes ()
 

Static Public Attributes

static TRANSACTION_TYPE_ALL = 0
 All type of transaction.
 
static TRANSACTION_TYPE_PURCHASE = 1
 Credits purchased by contacting Sensorscope Sàrl.
 
static TRANSACTION_TYPE_TRANSFER = 2
 Credits transferred to/from another user.
 
static TRANSACTION_TYPE_ALERT_SMS = 3
 Credits spent by sending an SMS alert.
 
static TRANSACTION_TYPE_ALERT_VOICE = 4
 Credits spent by sending a voice alert.
 
static TRANSACTION_TYPE_ONLINE_PURCHASE = 5
 Credits purchased directly on climaps.com.
 

Detailed Description

This class lets you access credits information of the user account the API key is tied to. Climaps credits are used for various purposes such as sending SMS or voice alerts.

Member Function Documentation

static credits::getOwnCredits ( )
static

Get balance information for the current user.

Returns

An object such as:

Property Type Description
credits int Number of credits left
creditsmin int Minimum number of credits allowed (generally 0, but can be negative as well)
static credits::getOwnTransactions ( )
static

Get a list of the current user's credits transactions.

Parameters
inttypeThe transaction type Id (e.g., credits::TRANSACTION_TYPE_ALL)
intfromBegining of the time interval, in epoch time
inttoEnd of the time interval, in epoch time
Returns

An array of objects such as:

Property Type Description
type string The transaction type id, see credits::getTransactionTypes
epoch int The date of the transaction, in epoch time
amount int An amount of credits
balance int The new account balance, after the transaction
details string Details of the transaction
Note
The array is sorted by the date of the transactions, most recent first.
The description of the transaction is automatically translated into the the user's current language (see account::getOwnSettings).
static credits::getTransactionTypes ( )
static

Get the list of all possible credits transactions.

These transactions are the different ways of acquiring or spending Climaps credits (e.g., sending an SMS alert, purchasing credits).

Returns

An array of objects such as:

Property Type Description
id int Id of the transaction type
description string Description of the transaction type
Note
The array is sorted by the id of the transaction types
The description of the transaction types is automatically translated into the the user's current language (see account::getOwnSettings)