All URIs are relative to https://cdn.emnify.net
Method | HTTP request | Description |
---|---|---|
applicationTokenByIdPatch | PATCH /api/v1/application_token/{app_token_id} | Update Application Token |
applicationTokenGet | GET /api/v1/application_token | List Application Tokens |
applicationTokenPost | POST /api/v1/application_token | Create Application Token |
applicationTokenByIdPatch($body, $app_token_id)
Update Application Token
The description
of the token may be updated and the Application Token can be revoked by updating the status
. The possible statuses of tokens are * \"id\": 0
- Activated * \"id\": 1
- Revoked
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP bearer authorization: bearerAuth
$config = Emnify\EmnifySdk\Configuration::getDefaultConfiguration()
->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Emnify\EmnifySdk\Api\ApplicationTokensApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \Emnify\EmnifySdk\Model\ApplicationToken(); // \Emnify\EmnifySdk\Model\ApplicationToken |
$app_token_id = 1.2; // float | application token ID
try {
$apiInstance->applicationTokenByIdPatch($body, $app_token_id);
} catch (Exception $e) {
echo 'Exception when calling ApplicationTokensApi->applicationTokenByIdPatch: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \Emnify\EmnifySdk\Model\ApplicationToken | ||
app_token_id | float | application token ID |
void (empty response body)
- Content-Type: application/json
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Emnify\EmnifySdk\Model\ListofApplicationTokensresponse[] applicationTokenGet()
List Application Tokens
Returns the list of application tokens for the organisation of the requesting user.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP bearer authorization: bearerAuth
$config = Emnify\EmnifySdk\Configuration::getDefaultConfiguration()
->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Emnify\EmnifySdk\Api\ApplicationTokensApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->applicationTokenGet();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ApplicationTokensApi->applicationTokenGet: ', $e->getMessage(), PHP_EOL;
}
?>
This endpoint does not need any parameter.
\Emnify\EmnifySdk\Model\ListofApplicationTokensresponse[]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Emnify\EmnifySdk\Model\CreateApplicationTokenresponse applicationTokenPost($body)
Create Application Token
Creates a new application token. ID must not be specified, as it is auto-generated and returned in case of a successful JSON response. You can provide following fields with this request: * description
(String, optional) * expiry_date
with optional time + time zone (String, optional) * ip
- IP Address in CIDR notation (String, optional)
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP bearer authorization: bearerAuth
$config = Emnify\EmnifySdk\Configuration::getDefaultConfiguration()
->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Emnify\EmnifySdk\Api\ApplicationTokensApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \Emnify\EmnifySdk\Model\CreateApplicationTokenrequest(); // \Emnify\EmnifySdk\Model\CreateApplicationTokenrequest |
try {
$result = $apiInstance->applicationTokenPost($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ApplicationTokensApi->applicationTokenPost: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
body | \Emnify\EmnifySdk\Model\CreateApplicationTokenrequest |
\Emnify\EmnifySdk\Model\CreateApplicationTokenresponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]