$apiInstance = new Fastly\Api\UserApi(
// 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
);Note
All URIs are relative to https://api.fastly.com
| Method | HTTP request | Description |
|---|---|---|
| createUser() | POST /user | Create a user |
| deleteUser() | DELETE /user/{user_id} | Delete a user |
| getCurrentUser() | GET /current_user | Get the current user |
| getUser() | GET /user/{user_id} | Get a user |
| requestPasswordReset() | POST /user/{user_login}/password/request_reset | Request a password reset |
| updateUser() | PUT /user/{user_id} | Update a user |
| updateUserPassword() | POST /current_user/password | Update the user's password |
createUser($options): \Fastly\Model\UserResponse // Create a userCreate a user.
$options['login'] = 'login_example'; // string
$options['name'] = 'name_example'; // string | The real life name of the user.
$options['limit_services'] = True; // bool | Indicates that the user has limited access to the customer's services.
$options['locked'] = True; // bool | Indicates whether the is account is locked for editing or not.
$options['require_new_password'] = True; // bool | Indicates if a new password is required at next login.
$options['role'] = new \Fastly\Model\RoleUser(); // \Fastly\Model\RoleUser
$options['roles'] = array('roles_example'); // string[] | A list of role IDs assigned to the user.
$options['two_factor_auth_enabled'] = True; // bool | Indicates if 2FA is enabled on the user.
$options['two_factor_setup_required'] = True; // bool | Indicates if 2FA is required by the user's customer account.
try {
$result = $apiInstance->createUser($options);
} catch (Exception $e) {
echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| login | string | [optional] | |
| name | string | The real life name of the user. | [optional] |
| limit_services | bool | Indicates that the user has limited access to the customer's services. | [optional] |
| locked | bool | Indicates whether the is account is locked for editing or not. | [optional] |
| require_new_password | bool | Indicates if a new password is required at next login. | [optional] |
| role | \Fastly\Model\RoleUser | [optional] | |
| roles | string[] | A list of role IDs assigned to the user. | [optional] |
| two_factor_auth_enabled | bool | Indicates if 2FA is enabled on the user. | [optional] |
| two_factor_setup_required | bool | Indicates if 2FA is required by the user's customer account. | [optional] |
[Back to top] [Back to API list] [Back to README]
deleteUser($options): \Fastly\Model\InlineResponse200 // Delete a userDelete a user.
$options['user_id'] = 'user_id_example'; // string | Alphanumeric string identifying the user.
try {
$result = $apiInstance->deleteUser($options);
} catch (Exception $e) {
echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | string | Alphanumeric string identifying the user. |
\Fastly\Model\InlineResponse200
[Back to top] [Back to API list] [Back to README]
getCurrentUser($options): \Fastly\Model\UserResponse // Get the current userGet the logged in user.
try {
$result = $apiInstance->getCurrentUser($options);
} catch (Exception $e) {
echo 'Exception when calling UserApi->getCurrentUser: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
This endpoint does not need any parameters.
[Back to top] [Back to API list] [Back to README]
getUser($options): \Fastly\Model\UserResponse // Get a userGet a specific user.
$options['user_id'] = 'user_id_example'; // string | Alphanumeric string identifying the user.
try {
$result = $apiInstance->getUser($options);
} catch (Exception $e) {
echo 'Exception when calling UserApi->getUser: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | string | Alphanumeric string identifying the user. |
[Back to top] [Back to API list] [Back to README]
requestPasswordReset($options): \Fastly\Model\InlineResponse200 // Request a password resetRequests a password reset for the specified user.
$options['user_login'] = 'user_login_example'; // string | The login associated with the user (typically, an email address).
try {
$result = $apiInstance->requestPasswordReset($options);
} catch (Exception $e) {
echo 'Exception when calling UserApi->requestPasswordReset: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| user_login | string | The login associated with the user (typically, an email address). |
\Fastly\Model\InlineResponse200
[Back to top] [Back to API list] [Back to README]
updateUser($options): \Fastly\Model\UserResponse // Update a userUpdate a user. Only users with the role of superuser can make changes to other users on the account. Non-superusers may use this endpoint to make changes to their own account. Two-factor attributes are not editable via this endpoint.
$options['user_id'] = 'user_id_example'; // string | Alphanumeric string identifying the user.
$options['login'] = 'login_example'; // string
$options['name'] = 'name_example'; // string | The real life name of the user.
$options['limit_services'] = True; // bool | Indicates that the user has limited access to the customer's services.
$options['locked'] = True; // bool | Indicates whether the is account is locked for editing or not.
$options['require_new_password'] = True; // bool | Indicates if a new password is required at next login.
$options['role'] = new \Fastly\Model\RoleUser(); // \Fastly\Model\RoleUser
$options['roles'] = array('roles_example'); // string[] | A list of role IDs assigned to the user.
$options['two_factor_auth_enabled'] = True; // bool | Indicates if 2FA is enabled on the user.
$options['two_factor_setup_required'] = True; // bool | Indicates if 2FA is required by the user's customer account.
try {
$result = $apiInstance->updateUser($options);
} catch (Exception $e) {
echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | string | Alphanumeric string identifying the user. | |
| login | string | [optional] | |
| name | string | The real life name of the user. | [optional] |
| limit_services | bool | Indicates that the user has limited access to the customer's services. | [optional] |
| locked | bool | Indicates whether the is account is locked for editing or not. | [optional] |
| require_new_password | bool | Indicates if a new password is required at next login. | [optional] |
| role | \Fastly\Model\RoleUser | [optional] | |
| roles | string[] | A list of role IDs assigned to the user. | [optional] |
| two_factor_auth_enabled | bool | Indicates if 2FA is enabled on the user. | [optional] |
| two_factor_setup_required | bool | Indicates if 2FA is required by the user's customer account. | [optional] |
[Back to top] [Back to API list] [Back to README]
updateUserPassword($options): \Fastly\Model\UserResponse // Update the user's passwordUpdate the user's password to a new one.
$options['old_password'] = 'old_password_example'; // string | The user's current password.
$options['new_password'] = 'new_password_example'; // string | The user's new password.
try {
$result = $apiInstance->updateUserPassword($options);
} catch (Exception $e) {
echo 'Exception when calling UserApi->updateUserPassword: ', $e->getMessage(), PHP_EOL;
}Note: the input parameter is an associative array with the keys listed below.
| Name | Type | Description | Notes |
|---|---|---|---|
| old_password | string | The user's current password. | [optional] |
| new_password | string | The user's new password. | [optional] |