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. |
\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.
<?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;
}
?>
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] |
- 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($id)
Deletes a CBRAIN user
Deletes a CBRAIN User from the database
<?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;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID of user to update |
void (empty response body)
- 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]
\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.
<?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;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
id | int | ID of the user |
- 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]
\Swagger\Client\Model\User usersIdPatch($id, $user_mod_req)
Update information about a user
Updates the information about a user
<?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;
}
?>
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 |
- 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]
\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.
<?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;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
user_mod_req | \Swagger\Client\Model\UserModReq | An object representing a request for a new User |
- 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]