getSessionInfo

Returns information about your current session.

getSessionInfo

Returns information about your current session.

Top ↑

Syntax

array getSessionInfo( string api_key );

Parameters

api_key (string)

The key required to access the API. See Getting Started for more information.

Return Value

An array containing the following fields:

Key Type Description
account_id int The Account ID you are accessing.
user_id int The User ID you are using to access the system.
username string The username you are using to access the system.
session_start_time int The time that your current session began (timestamp in seconds).
login_account_id int The Account ID that your API key accesses; this will only be different from account_id if you are logged in to a sub-account.
login_user_id int The User ID associated with your API key.
login_username string The username associated with your API key.

Examples

$api = new Api($url, 'YOURAPIKEY');
$session_details = $api->invokeMethod('getSessionInfo');
{
    "id": 1,
    "method": "getSessionInfo",
    "params": [
        "YOURAPIKEY"
    ]
}
{
    "id": 1,
    "result": {
        "account_id": 12345,
        "user_id": 678910,
        "username": "jdoe",
        "session_start_time": 1359436107,
        "login_account_id": 12345,
        "login_user_id": 678910,
        "login_username": "jdoe"
    },
    "error": null
}

See Also