Enables or disables a portal user
PUThttps://api.iot.telenor.com/identity-access-management/domains/:id/portal-users/:portalUserId/enabled
Change a portal user's status. This determines whether a portal user can log in or not.
Request
Path Parameters
Identifies the domain in Keycloak.
Identifies the portal user.
- application/json
Bodyrequired
States whether to enable or disable the portal user.
Sets a user to active if true or inactive if false.
Responses
- 204
- 400
- 401
- 403
- 404
The portal user's status has been updated.
Response Headers
Bad request. The server cannot process the request.
- application/json
- Schema
- Example (auto)
Schema
Human readable description of the error
Invalid parameter.
Following errors are defined for this service:
400 Bad Request Errors
INVALID_REQUEST_BODY
Request body is invalid. Must contain valid JSON.
INVALID_EMAIL
Invalid value for the property email
. Must be a valid email.
INVALID_CLIENT_ID_PREFIX
Invalid value for the property clientIdPrefix
. Allowed characters are A-Z, a-z, 0-9, as well as underscore (_) and hyphen (-). Client id must not be longer than 128 characters.
NOT_ALLOWED_TO_MANAGE_SELF
Not allowed to manage your own user.
INVALID_USER_STATUS
Invalid value for the property enabled
. Boolean values are allowed.
INVALID_SEARCH_VALUE
Invalid value for the query parameter search
. Most Unicode characters are allowed..
INVALID_OFFSET_VALUE
Invalid value for the query parameter offset
. Number between 0 and 1000000 is allowed.
INVALID_LIMIT_VALUE
Invalid value for the query parameter limit
. Number between 0 and 100 is allowed.
INVALID_ROLES_ARRAY
Invalid value for the property roles
. Must be of type array ([]) containing between 0 and 100 roles.
INVALID_SOLUTIONS_ARRAY
Invalid value for the property solutions
. Must be of type array ([]) containing between 0 and 100 solutions.
INVALID_SOLUTION
Invalid value for one or more entries in the solutions
array. Alphabetic characters, numbers, and some special characters are allowed.
INVALID_USER_ROLES
Invalid content in property roles
. Each role must contain property id
with UUID formatting and property type
specifying whether the role is global
or custom
.
INVALID_SYSTEM_USER_ROLES
Invalid content in property roles
. Each role must contain property id
with UUID formatting and property type
with value global
.
INVALID_GLOBAL_ROLE
At least one of the requested global roles is invalid.
INVALID_NAME
Invalid value for the property name
. Alphabetic characters, numbers, and some special characters are allowed.
INVALID_PHONE_NUMBER
Invalid value for the property phoneNumber
. Must be of type string containing between 4 and 20 numbers.
INVALID_PARENT_DOMAIN_ID
Invalid value for the property parentId
. Must contain a string with UUID formatting.
INVALID_DOMAIN_ID
Invalid value for the property 'domainId'. Must contain a string.
PARENT_DOMAIN_NOT_FOUND
The domain specified in the property parentId
could not be found.
401 Unauthorized Errors
INVALID_TOKEN
Access token is not valid.
403 Forbidden Errors
FORBIDDEN_ERROR
Not authorized to access this resource.
FORBIDDEN_ROLE_UPDATE
Forbidden operation since it would result in the addition or removal of a role the requesting user does not have themselves.
FORBIDDEN_IDENTICAL_DOMAIN_UPDATE
User already belongs to the specified domain.
FORBIDDEN_SOLUTION
Forbidden operation since it would result in the addition or removal of a solution the requesting user does not have themselves.
FORBIDDEN_ROOT_DOMAIN_SOLUTIONS_UPDATE
Not allowed to change solutions for root domain.
404 Not Found Errors
RESOURCE_NOT_FOUND
Requested resource does not exist.
409 Conflict Errors
CONFLICT_ERROR
Resource already exists.
500 Internal Server Errors
SERVICE_ERROR
Error occurred when communicating with another service. Please try again or contact your system administrator if this problem persists.
ACCESS_TOKEN_ERROR
Unexpected error with access token. Please try logging out and in again or contact your system administrator if this problem persists.
CREATE_DOMAIN_ERROR
Domain could not be created due to an unexpected internal error. Please try again or contact your system administrator if this problem persists.
503 Service Unavailable Errors
CRITICAL_SERVICE_ERROR
Unable to communicate with another service. Please try again or contact your system administrator if this problem persists.
INVALID_REQUEST
Epoch timestamp specifying when error occurred
1560954657369
{
"description": "Invalid parameter.",
"errorCode": "INVALID_REQUEST",
"timestamp": 1560954657369
}
Invalid or missing access token (JWT).
Not authorized to access this resource.
Entity not found.
- application/json
- Schema
- Example (auto)
Schema
Human readable description of the error
Requested resource does not exist.
Following errors are defined for this service:
400 Bad Request Errors
INVALID_REQUEST_BODY
Request body is invalid. Must contain valid JSON.
INVALID_EMAIL
Invalid value for the property email
. Must be a valid email.
INVALID_CLIENT_ID_PREFIX
Invalid value for the property clientIdPrefix
. Allowed characters are A-Z, a-z, 0-9, as well as underscore (_) and hyphen (-). Client id must not be longer than 128 characters.
NOT_ALLOWED_TO_MANAGE_SELF
Not allowed to manage your own user.
INVALID_USER_STATUS
Invalid value for the property enabled
. Boolean values are allowed.
INVALID_SEARCH_VALUE
Invalid value for the query parameter search
. Most Unicode characters are allowed..
INVALID_OFFSET_VALUE
Invalid value for the query parameter offset
. Number between 0 and 1000000 is allowed.
INVALID_LIMIT_VALUE
Invalid value for the query parameter limit
. Number between 0 and 100 is allowed.
INVALID_ROLES_ARRAY
Invalid value for the property roles
. Must be of type array ([]) containing between 0 and 100 roles.
INVALID_SOLUTIONS_ARRAY
Invalid value for the property solutions
. Must be of type array ([]) containing between 0 and 100 solutions.
INVALID_SOLUTION
Invalid value for one or more entries in the solutions
array. Alphabetic characters, numbers, and some special characters are allowed.
INVALID_USER_ROLES
Invalid content in property roles
. Each role must contain property id
with UUID formatting and property type
specifying whether the role is global
or custom
.
INVALID_SYSTEM_USER_ROLES
Invalid content in property roles
. Each role must contain property id
with UUID formatting and property type
with value global
.
INVALID_GLOBAL_ROLE
At least one of the requested global roles is invalid.
INVALID_NAME
Invalid value for the property name
. Alphabetic characters, numbers, and some special characters are allowed.
INVALID_PHONE_NUMBER
Invalid value for the property phoneNumber
. Must be of type string containing between 4 and 20 numbers.
INVALID_PARENT_DOMAIN_ID
Invalid value for the property parentId
. Must contain a string with UUID formatting.
INVALID_DOMAIN_ID
Invalid value for the property 'domainId'. Must contain a string.
PARENT_DOMAIN_NOT_FOUND
The domain specified in the property parentId
could not be found.
401 Unauthorized Errors
INVALID_TOKEN
Access token is not valid.
403 Forbidden Errors
FORBIDDEN_ERROR
Not authorized to access this resource.
FORBIDDEN_ROLE_UPDATE
Forbidden operation since it would result in the addition or removal of a role the requesting user does not have themselves.
FORBIDDEN_IDENTICAL_DOMAIN_UPDATE
User already belongs to the specified domain.
FORBIDDEN_SOLUTION
Forbidden operation since it would result in the addition or removal of a solution the requesting user does not have themselves.
FORBIDDEN_ROOT_DOMAIN_SOLUTIONS_UPDATE
Not allowed to change solutions for root domain.
404 Not Found Errors
RESOURCE_NOT_FOUND
Requested resource does not exist.
409 Conflict Errors
CONFLICT_ERROR
Resource already exists.
500 Internal Server Errors
SERVICE_ERROR
Error occurred when communicating with another service. Please try again or contact your system administrator if this problem persists.
ACCESS_TOKEN_ERROR
Unexpected error with access token. Please try logging out and in again or contact your system administrator if this problem persists.
CREATE_DOMAIN_ERROR
Domain could not be created due to an unexpected internal error. Please try again or contact your system administrator if this problem persists.
503 Service Unavailable Errors
CRITICAL_SERVICE_ERROR
Unable to communicate with another service. Please try again or contact your system administrator if this problem persists.
RESOURCE_NOT_FOUND
Epoch timestamp specifying when error occurred
1560954657369
{
"description": "Requested resource does not exist.",
"errorCode": "RESOURCE_NOT_FOUND",
"timestamp": 1560954657369
}
Authorization: oauth2
name: oAuth2type: oauth2scopes:openid
flows: { "authorizationCode": { "tokenUrl": "/auth/realms/telenor-iot/protocol/openid-connect/token", "authorizationUrl": "/auth/realms/telenor-iot/protocol/openid-connect/auth", "scopes": { "openid": "openid" } }, "clientCredentials": { "tokenUrl": "/auth/realms/telenor-iot/protocol/openid-connect/token", "scopes": { "openid": "openid" } } }
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://api.iot.telenor.com/identity-access-management/domains/:id/portal-users/:portalUserId/enabled");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"enabled\": true\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());