import 'package:spanapi/api.dart';
All URIs are relative to https://api.lab5e.com
Method | HTTP request | Description |
---|---|---|
createCollection | POST /span/collections | Create collection |
deleteCollection | DELETE /span/collections/{collectionId} | Delete collection |
listCollectionData | GET /span/collections/{collectionId}/data | Retrieve data from devices |
listCollections | GET /span/collections | List collections |
retrieveCollection | GET /span/collections/{collectionId} | Retrieve collection |
retrieveCollectionStats | GET /span/collections/{collectionId}/stats | Retrieve collection statistics |
updateCollection | PATCH /span/collections/{collectionId} | Update collection |
Collection createCollection(body)
Create collection
Create a new collection
import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';
final api_instance = CollectionsApi();
final body = CreateCollectionRequest(); // CreateCollectionRequest | Request object when creating a collection. The collect ID is assigned by the service.
try {
final result = api_instance.createCollection(body);
print(result);
} catch (e) {
print('Exception when calling CollectionsApi->createCollection: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
body | CreateCollectionRequest | Request object when creating a collection. The collect ID is assigned by the service. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Collection deleteCollection(collectionId)
Delete collection
Remove the collection. Devices, firmware images, outputs and all other related resources must be removed from the collection before it can be deleted.
import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';
final api_instance = CollectionsApi();
final collectionId = collectionId_example; // String | The ID of the collection you want to delete
try {
final result = api_instance.deleteCollection(collectionId);
print(result);
} catch (e) {
print('Exception when calling CollectionsApi->deleteCollection: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | String | The ID of the collection you want to delete |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListDataResponse listCollectionData(collectionId, limit, start, end, offset)
Retrieve data from devices
Retrieve data sent by the devices in the collection. The maximum number of data points is 100.
import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';
final api_instance = CollectionsApi();
final collectionId = collectionId_example; // String | The collection ID requested. This is included in the request path.
final limit = 56; // int | Limit the number of payloads to return. The default is 512.
final start = start_example; // String | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch.
final end = end_example; // String | End of time range. The default is the current time stamp. Value is in milliseconds since epoch.
final offset = offset_example; // String | The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned.
try {
final result = api_instance.listCollectionData(collectionId, limit, start, end, offset);
print(result);
} catch (e) {
print('Exception when calling CollectionsApi->listCollectionData: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | String | The collection ID requested. This is included in the request path. | |
limit | int | Limit the number of payloads to return. The default is 512. | [optional] |
start | String | Start of time range. The default is 24 hours ago. Value is in milliseconds since epoch. | [optional] |
end | String | End of time range. The default is the current time stamp. Value is in milliseconds since epoch. | [optional] |
offset | String | The message offset based on the message ID. This parameter can't be combined with the start and end parameters. If no parameter is set the first N messages will be returned. If this parameter is set the next N messages (from newest to oldest) with message ID less than the offset will be returned. | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListCollectionResponse listCollections()
List collections
Lists all the collections that one of your teams owns. The collections returned includes only the data on the collection and not the summary information
import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';
final api_instance = CollectionsApi();
try {
final result = api_instance.listCollections();
print(result);
} catch (e) {
print('Exception when calling CollectionsApi->listCollections: $e\n');
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Collection retrieveCollection(collectionId, upstream, downstream)
Retrieve collection
Retrieve collection information. This includes a list of the most recent messages in the inbox. The upstream and downstream parameters are optional and if set to true will include the timestamps for up to 100 messages up- and downstream for the last hour.
import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';
final api_instance = CollectionsApi();
final collectionId = collectionId_example; // String | The collection ID of the collection you are requesting
final upstream = true; // bool |
final downstream = true; // bool |
try {
final result = api_instance.retrieveCollection(collectionId, upstream, downstream);
print(result);
} catch (e) {
print('Exception when calling CollectionsApi->retrieveCollection: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | String | The collection ID of the collection you are requesting | |
upstream | bool | [optional] | |
downstream | bool | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CollectionStats retrieveCollectionStats(collectionId)
Retrieve collection statistics
Retrieve statistics for the collection. This is the aggregated metrics for devices, outputs, firmware images, blobs and gateways in the collection
import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';
final api_instance = CollectionsApi();
final collectionId = collectionId_example; // String | The collection ID of the collection you are requesting
try {
final result = api_instance.retrieveCollectionStats(collectionId);
print(result);
} catch (e) {
print('Exception when calling CollectionsApi->retrieveCollectionStats: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | String | The collection ID of the collection you are requesting |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Collection updateCollection(collectionId, body)
Update collection
Update a collection.
import 'package:spanapi/api.dart';
// TODO Configure API key authorization: APIToken
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIToken').apiKeyPrefix = 'Bearer';
final api_instance = CollectionsApi();
final collectionId = collectionId_example; // String | The ID of the collection. This is assigned by the backend.
final body = UpdateCollectionBody(); // UpdateCollectionBody |
try {
final result = api_instance.updateCollection(collectionId, body);
print(result);
} catch (e) {
print('Exception when calling CollectionsApi->updateCollection: $e\n');
}
Name | Type | Description | Notes |
---|---|---|---|
collectionId | String | The ID of the collection. This is assigned by the backend. | |
body | UpdateCollectionBody |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]