Skip to content

Latest commit

 

History

History
777 lines (555 loc) · 28 KB

UsersApi.md

File metadata and controls

777 lines (555 loc) · 28 KB

knowgo.api.UsersApi

Load the API package

import 'package:knowgo/api.dart';

All URIs are relative to https://api.adaptant.io/v1

Method HTTP request Description
confirmUserPasswordChangeByRecovery POST /users/password/confirm Confirm the change in user password via the recovery mechanism
createUser POST /users Create user
deleteUser DELETE /users/{userId} Delete user
disableServiceByUserId DELETE /users/{userId}/services/{serviceName} Disable a service for a specific user
enableServiceByUserId POST /users/{userId}/services/{serviceName} Enable a service for a specific user
exportUser GET /users/{userId}/export Exports all data about current user in CSV format
getUserById GET /users/{userId} Get user by user id
listJourneysByUserId GET /users/{userId}/journeys Return a list of journeys available for a specific user
listServicesByUserId GET /users/{userId}/services Return a list of services for a specific user
listVehiclesByUserId GET /users/{userId}/vehicles Return a list of vehicles available for a specific user
loginUser POST /users/login Logs user into the system and returns an authentication token.
logoutUser GET /users/logout Logs out current logged in user session
recoverUserPassword POST /users/password/recover Initiaties a password recovery operation for the designated user.
refreshToken GET /users/refresh Refreshes the session token for a logged-in user
updateUser PUT /users/{userId} Updated user

confirmUserPasswordChangeByRecovery

confirmUserPasswordChangeByRecovery(passwordRecoveryConfirmation)

Confirm the change in user password via the recovery mechanism

Example

import 'package:knowgo/api.dart';

var api_instance = UsersApi();
var passwordRecoveryConfirmation = PasswordRecoveryConfirmation(); // PasswordRecoveryConfirmation | User email, new password and reset token to initiate password change

try { 
    api_instance.confirmUserPasswordChangeByRecovery(passwordRecoveryConfirmation);
} catch (e) {
    print("Exception when calling UsersApi->confirmUserPasswordChangeByRecovery: $e\n");
}

Parameters

Name Type Description Notes
passwordRecoveryConfirmation PasswordRecoveryConfirmation User email, new password and reset token to initiate password change

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

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

createUser

User createUser(user)

Create user

Create a new user within the system

Example

import 'package:knowgo/api.dart';

var api_instance = UsersApi();
var user = User(); // User | User object to operate on

try { 
    var result = api_instance.createUser(user);
    print(result);
} catch (e) {
    print("Exception when calling UsersApi->createUser: $e\n");
}

Parameters

Name Type Description Notes
user User User object to operate on

Return type

User

Authorization

No authorization required

HTTP request headers

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

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

deleteUser

deleteUser(userId)

Delete user

This can only be done by the logged in user.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();
var userId = 789; // int | ID of user that needs to be fetched

try { 
    api_instance.deleteUser(userId);
} catch (e) {
    print("Exception when calling UsersApi->deleteUser: $e\n");
}

Parameters

Name Type Description Notes
userId int ID of user that needs to be fetched [default to null]

Return type

void (empty response body)

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

disableServiceByUserId

disableServiceByUserId(userId, serviceName)

Disable a service for a specific user

Given an authenticated user, disable a specific service that the user no longer wishes to use.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();
var userId = 789; // int | ID of user that needs to be fetched
var serviceName = serviceName_example; // String | Name of service to disable

try { 
    api_instance.disableServiceByUserId(userId, serviceName);
} catch (e) {
    print("Exception when calling UsersApi->disableServiceByUserId: $e\n");
}

Parameters

Name Type Description Notes
userId int ID of user that needs to be fetched [default to null]
serviceName String Name of service to disable [default to null]

Return type

void (empty response body)

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

enableServiceByUserId

enableServiceByUserId(userId, serviceName)

Enable a service for a specific user

Given an authenticated user, enable a specific service that the user wishes to use.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();
var userId = 789; // int | ID of user that needs to be fetched
var serviceName = serviceName_example; // String | Name of service to enable

try { 
    api_instance.enableServiceByUserId(userId, serviceName);
} catch (e) {
    print("Exception when calling UsersApi->enableServiceByUserId: $e\n");
}

Parameters

Name Type Description Notes
userId int ID of user that needs to be fetched [default to null]
serviceName String Name of service to enable [default to null]

Return type

void (empty response body)

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

exportUser

exportUser(userId)

Exports all data about current user in CSV format

This endpoint allows a logged in user to export all of the data pertaining to their userId from across the system in a simple CSV format, facilitating their right to data and service portability. This includes not only the personal information about the individual, but also all vehicles they are (or have been) associated with, journeys taken, and all events recorded.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();
var userId = 789; // int | ID of user that needs to be fetched

try { 
    api_instance.exportUser(userId);
} catch (e) {
    print("Exception when calling UsersApi->exportUser: $e\n");
}

Parameters

Name Type Description Notes
userId int ID of user that needs to be fetched [default to null]

Return type

void (empty response body)

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

getUserById

User getUserById(userId)

Get user by user id

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();
var userId = 789; // int | ID of user that needs to be fetched

try { 
    var result = api_instance.getUserById(userId);
    print(result);
} catch (e) {
    print("Exception when calling UsersApi->getUserById: $e\n");
}

Parameters

Name Type Description Notes
userId int ID of user that needs to be fetched [default to null]

Return type

User

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

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

listJourneysByUserId

List listJourneysByUserId(userId)

Return a list of journeys available for a specific user

Given an authenticated user, return a list of journeys that are available to them.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();
var userId = 789; // int | ID of user that needs to be fetched

try { 
    var result = api_instance.listJourneysByUserId(userId);
    print(result);
} catch (e) {
    print("Exception when calling UsersApi->listJourneysByUserId: $e\n");
}

Parameters

Name Type Description Notes
userId int ID of user that needs to be fetched [default to null]

Return type

List

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

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

listServicesByUserId

List listServicesByUserId(userId)

Return a list of services for a specific user

Given an authenticated user, return a list of services that they have opted in to. This will include a subset of the '/services' result, and will persist regardless of the availability or lack of availability of a given service.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();
var userId = 789; // int | ID of user that needs to be fetched

try { 
    var result = api_instance.listServicesByUserId(userId);
    print(result);
} catch (e) {
    print("Exception when calling UsersApi->listServicesByUserId: $e\n");
}

Parameters

Name Type Description Notes
userId int ID of user that needs to be fetched [default to null]

Return type

List

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

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

listVehiclesByUserId

List listVehiclesByUserId(userId)

Return a list of vehicles available for a specific user

Given an authenticated user, return a list of vehicles that are available to them.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();
var userId = 789; // int | ID of user that needs to be fetched

try { 
    var result = api_instance.listVehiclesByUserId(userId);
    print(result);
} catch (e) {
    print("Exception when calling UsersApi->listVehiclesByUserId: $e\n");
}

Parameters

Name Type Description Notes
userId int ID of user that needs to be fetched [default to null]

Return type

List

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

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

loginUser

String loginUser(username, password, authCredentials)

Logs user into the system and returns an authentication token.

Example

import 'package:knowgo/api.dart';

var api_instance = UsersApi();
var username = username_example; // String | The user's username or email address for login
var password = password_example; // String | The password for login in clear text
var authCredentials = AuthCredentials(); // AuthCredentials | Basic Auth credentials for user authentication

try { 
    var result = api_instance.loginUser(username, password, authCredentials);
    print(result);
} catch (e) {
    print("Exception when calling UsersApi->loginUser: $e\n");
}

Parameters

Name Type Description Notes
username String The user's username or email address for login [optional] [default to null]
password String The password for login in clear text [optional] [default to null]
authCredentials AuthCredentials Basic Auth credentials for user authentication [optional]

Return type

String

Authorization

No authorization required

HTTP request headers

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

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

logoutUser

logoutUser()

Logs out current logged in user session

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();

try { 
    api_instance.logoutUser();
} catch (e) {
    print("Exception when calling UsersApi->logoutUser: $e\n");
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

recoverUserPassword

recoverUserPassword(email, body)

Initiaties a password recovery operation for the designated user.

Example

import 'package:knowgo/api.dart';

var api_instance = UsersApi();
var email = ; // String | The user's email address to recover the password for.
var body = String(); // String | User email address to initiate password recovery procedure for

try { 
    api_instance.recoverUserPassword(email, body);
} catch (e) {
    print("Exception when calling UsersApi->recoverUserPassword: $e\n");
}

Parameters

Name Type Description Notes
email String The user's email address to recover the password for. [optional] [default to null]
body String User email address to initiate password recovery procedure for [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

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

refreshToken

refreshToken()

Refreshes the session token for a logged-in user

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();

try { 
    api_instance.refreshToken();
} catch (e) {
    print("Exception when calling UsersApi->refreshToken: $e\n");
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

updateUser

updateUser(userId, user)

Updated user

This can only be done by the logged in user.

Example

import 'package:knowgo/api.dart';
// TODO Configure API key authorization: app_id
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('app_id').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP basic authorization: bearerAuth
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication<HttpBasicAuth>('bearerAuth').password = 'YOUR_PASSWORD';
// TODO Configure API key authorization: cookieAuth
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookieAuth').apiKeyPrefix = 'Bearer';

var api_instance = UsersApi();
var userId = 789; // int | ID of user that needs to be fetched
var user = User(); // User | Updated user object

try { 
    api_instance.updateUser(userId, user);
} catch (e) {
    print("Exception when calling UsersApi->updateUser: $e\n");
}

Parameters

Name Type Description Notes
userId int ID of user that needs to be fetched [default to null]
user User Updated user object

Return type

void (empty response body)

Authorization

app_id, bearerAuth, cookieAuth

HTTP request headers

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

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