This method does requires authentication.
This method is called with HTTP method GET.
| Argument | Type | Element (array) | Valid Values | Default Value | Detail |
|---|---|---|---|---|---|
token |
string | authenticated session id (stored in the session $_SESSION['token']) | required | User Token |
| Element (path) | Name | Type | Description | |||||
|---|---|---|---|---|---|---|---|---|
| / | token | string | authenticated session id (needed for methods needed authentication) | |||||
| / | text | array |
|
GET http://testapi.wannaprint.com/Rest/1/[API Key]/api/refreshToken/token=[token]
<?php
session_start();
$api_items = $apicaller->sendRequest(array(
'controller' => 'api',
'action' => 'refreshToken',
'token' => $_SESSION['token']
));
foreach($api_items->text as $text)
{
echo $text;
}
$_SESSION['token'] = $api_items->token;
?>
{
"text":[
"Old Token : old_authentication_token",
"New Token : new_authentication_token"
],
"token": "new_authentication_token"
}
or
{
"text":["ERROR: You have to be authentified to use this method!"]
}
001: Wrong API Key002: Failed to parse request011: Controller is invalid.031: Invalid Method