Skip to content

Latest commit

 

History

History
291 lines (207 loc) · 10.2 KB

UsersApi.md

File metadata and controls

291 lines (207 loc) · 10.2 KB

Swagger\Client\UsersApi

All URIs are relative to http://localhost:3000

Method HTTP request Description
usersGet GET /users Returns all of the users in CBRAIN. Only available to admins.
usersIdDelete DELETE /users/{id} Deletes a CBRAIN user
usersIdGet GET /users/{id} Returns information about a user
usersIdPatch PATCH /users/{id} Update information about a user
usersPost POST /users Create a new user in CBRAIN. Only available to admins.

usersGet

\Swagger\Client\Model\User[] usersGet($page, $per_page)

Returns all of the users in CBRAIN. Only available to admins.

Returns all of the users registered in CBRAIN, as well as information on their permissions and group/site memberships.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: BrainPortalSession
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('cbrain_api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('cbrain_api_token', 'Bearer');

$apiInstance = new Swagger\Client\Api\UsersApi(
    // 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
);
$page = 56; // int | Page number when paginating. See also the per_page parameter
$per_page = 56; // int | Size of each page when paginating. See also the page parameter

try {
    $result = $apiInstance->usersGet($page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->usersGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
page int Page number when paginating. See also the per_page parameter [optional]
per_page int Size of each page when paginating. See also the page parameter [optional]

Return type

\Swagger\Client\Model\User[]

Authorization

BrainPortalSession

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json, application/xml

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

usersIdDelete

usersIdDelete($id)

Deletes a CBRAIN user

Deletes a CBRAIN User from the database

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: BrainPortalSession
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('cbrain_api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('cbrain_api_token', 'Bearer');

$apiInstance = new Swagger\Client\Api\UsersApi(
    // 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
);
$id = 56; // int | ID of user to update

try {
    $apiInstance->usersIdDelete($id);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->usersIdDelete: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int ID of user to update

Return type

void (empty response body)

Authorization

BrainPortalSession

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json, application/xml

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

usersIdGet

\Swagger\Client\Model\User usersIdGet($id)

Returns information about a user

Returns the information about the user associated with the ID given in argument. A normal user only has access to her own information, while an administrator or site manager can have access to a larger set of users.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: BrainPortalSession
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('cbrain_api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('cbrain_api_token', 'Bearer');

$apiInstance = new Swagger\Client\Api\UsersApi(
    // 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
);
$id = 56; // int | ID of the user

try {
    $result = $apiInstance->usersIdGet($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->usersIdGet: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int ID of the user

Return type

\Swagger\Client\Model\User

Authorization

BrainPortalSession

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json, application/xml

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

usersIdPatch

\Swagger\Client\Model\User usersIdPatch($id, $user_mod_req)

Update information about a user

Updates the information about a user

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: BrainPortalSession
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('cbrain_api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('cbrain_api_token', 'Bearer');

$apiInstance = new Swagger\Client\Api\UsersApi(
    // 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
);
$id = 56; // int | ID of user to update
$user_mod_req = new \Swagger\Client\Model\UserModReq(); // \Swagger\Client\Model\UserModReq | An object representing a request for a new User

try {
    $result = $apiInstance->usersIdPatch($id, $user_mod_req);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->usersIdPatch: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
id int ID of user to update
user_mod_req \Swagger\Client\Model\UserModReq An object representing a request for a new User

Return type

\Swagger\Client\Model\User

Authorization

BrainPortalSession

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json, application/xml

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

usersPost

\Swagger\Client\Model\User usersPost($user_mod_req)

Create a new user in CBRAIN. Only available to admins.

Creates a new user in CBRAIN. Only admins can create new users.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: BrainPortalSession
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('cbrain_api_token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('cbrain_api_token', 'Bearer');

$apiInstance = new Swagger\Client\Api\UsersApi(
    // 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
);
$user_mod_req = new \Swagger\Client\Model\UserModReq(); // \Swagger\Client\Model\UserModReq | An object representing a request for a new User

try {
    $result = $apiInstance->usersPost($user_mod_req);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UsersApi->usersPost: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
user_mod_req \Swagger\Client\Model\UserModReq An object representing a request for a new User

Return type

\Swagger\Client\Model\User

Authorization

BrainPortalSession

HTTP request headers

  • Content-Type: application/json, multipart/form-data
  • Accept: application/json, application/xml

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