9.6 KiB
openapi.api.ActivitiesApi
Load the API package
import 'package:openapi/api.dart';
All URIs are relative to /api
| Method | HTTP request | Description |
|---|---|---|
| createActivity | POST /activities | Create an activity |
| deleteActivity | DELETE /activities/{id} | Delete an activity |
| getActivities | GET /activities | List all activities |
| getActivityStatistics | GET /activities/statistics | Retrieve activity statistics |
createActivity
ActivityResponseDto createActivity(activityCreateDto)
Create an activity
Create a like or a comment for an album, or an asset in an album.
Example
import 'package:openapi/api.dart';
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = ActivitiesApi();
final activityCreateDto = ActivityCreateDto(); // ActivityCreateDto |
try {
final result = api_instance.createActivity(activityCreateDto);
print(result);
} catch (e) {
print('Exception when calling ActivitiesApi->createActivity: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| activityCreateDto | ActivityCreateDto |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteActivity
deleteActivity(id)
Delete an activity
Removes a like or comment from a given album or asset in an album.
Example
import 'package:openapi/api.dart';
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = ActivitiesApi();
final id = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String |
try {
api_instance.deleteActivity(id);
} catch (e) {
print('Exception when calling ActivitiesApi->deleteActivity: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | String |
Return type
void (empty response body)
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getActivities
List getActivities(albumId, assetId, level, type, userId)
List all activities
Returns a list of activities for the selected asset or album. The activities are returned in sorted order, with the oldest activities appearing first.
Example
import 'package:openapi/api.dart';
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = ActivitiesApi();
final albumId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Album ID
final assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Asset ID (if activity is for an asset)
final level = ; // ReactionLevel |
final type = ; // ReactionType |
final userId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Filter by user ID
try {
final result = api_instance.getActivities(albumId, assetId, level, type, userId);
print(result);
} catch (e) {
print('Exception when calling ActivitiesApi->getActivities: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| albumId | String | Album ID | |
| assetId | String | Asset ID (if activity is for an asset) | [optional] |
| level | ReactionLevel | [optional] | |
| type | ReactionType | [optional] | |
| userId | String | Filter by user ID | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getActivityStatistics
ActivityStatisticsResponseDto getActivityStatistics(albumId, assetId)
Retrieve activity statistics
Returns the number of likes and comments for a given album or asset in an album.
Example
import 'package:openapi/api.dart';
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = ActivitiesApi();
final albumId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Album ID
final assetId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Asset ID (if activity is for an asset)
try {
final result = api_instance.getActivityStatistics(albumId, assetId);
print(result);
} catch (e) {
print('Exception when calling ActivitiesApi->getActivityStatistics: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| albumId | String | Album ID | |
| assetId | String | Asset ID (if activity is for an asset) | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]