Skip to content

Latest commit

 

History

History
160 lines (114 loc) · 5.05 KB

UsersApi.md

File metadata and controls

160 lines (114 loc) · 5.05 KB

gruene_api_client.api.UsersApi

Load the API package

import 'package:gruene_api_client/api.dart';

All URIs are relative to https://app.gruene.de

Method HTTP request Description
findUsers GET /v0/users Find users
getSelf GET /v0/users/self Get the authenticated user
getUser GET /v0/users/{userId} Get user by id

findUsers

FindUsersResponse findUsers(search, userIds, limit)

Find users

Example

import 'package:gruene_api_client/api.dart';
// 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 basic authorization: bearer
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearer').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearer').password = 'YOUR_PASSWORD';

final api = GrueneApiClient().getUsersApi();
final String search = search_example; // String | Search term to look for in firstname, lastname, email, username.
final BuiltList<String> userIds = ; // BuiltList<String> | Only return users with matching user id.
final num limit = 8.14; // num | 

try {
    final response = api.findUsers(search, userIds, limit);
    print(response);
} catch on DioError (e) {
    print('Exception when calling UsersApi->findUsers: $e\n');
}

Parameters

Name Type Description Notes
search String Search term to look for in firstname, lastname, email, username. [optional]
userIds BuiltList<String> Only return users with matching user id. [optional]
limit num [optional]

Return type

FindUsersResponse

Authorization

api_key, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getSelf

User getSelf()

Get the authenticated user

Example

import 'package:gruene_api_client/api.dart';
// 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 basic authorization: bearer
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearer').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearer').password = 'YOUR_PASSWORD';

final api = GrueneApiClient().getUsersApi();

try {
    final response = api.getSelf();
    print(response);
} catch on DioError (e) {
    print('Exception when calling UsersApi->getSelf: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

User

Authorization

api_key, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getUser

User getUser(userId)

Get user by id

Example

import 'package:gruene_api_client/api.dart';
// 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 basic authorization: bearer
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearer').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearer').password = 'YOUR_PASSWORD';

final api = GrueneApiClient().getUsersApi();
final String userId = userId_example; // String | 

try {
    final response = api.getUser(userId);
    print(response);
} catch on DioError (e) {
    print('Exception when calling UsersApi->getUser: $e\n');
}

Parameters

Name Type Description Notes
userId String

Return type

User

Authorization

api_key, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]