General Information
Service | API | Method | Data Model | Workflow |
---|---|---|---|---|
urac | /admin/user/self/invite | PUT |
|
Description
Get the user by id or email or username where status is active, if not provided get it from the access token.
if not found return error
if found continue with the following steps:
check if already invited to this tenant
if yes return an error
if no, generate pin if code is set to yes
if failed to generate pin return an error
invite the user by updating its allowedTenants
send an email to the user with the generated pin
Input
Type: application/json
Name | Source | Mandatory | Type | Special Format | Description |
---|---|---|---|---|---|
user | Body | NOW | Object | Includes ONE of id, username, or email | User object, if not set username will be fetch from access token |
Name | Mandatory | type | Description | ||
id | YES | string | User Id | ||
username | YES | string | Username | ||
YES | User email | ||||
tenant | Body | YES | Object | Includes tenant id, and code | Tenant object |
Name | Mandatory | type | Description | ||
id | YES | string | tenant id | ||
code | YES | string | tenant code | ||
groups | Body | NO | Array | Array of strings | Groups array |
pin | Body | NO | Object | Includes code and allowed parameters | Pin object |
Name | Mandatory | type | Description | ||
code | YES | Boolean | Set to true to create random code | ||
allowed | YES | Boolean | Set to true if this user is allowed to start pin login |
Output
Response
SOAJS has a unified response. Check out this link to understand more the schema of SOAJS response
Valid Response
{ result: true, data: { id: '%user_id%', tenant: { id: '%tenant_id%', code: '%tenant_code% } } } |
Invalid Response
{ "result":false, "errors":{ "codes":[602], "details":[ { "code":602, "message":"Model error: + %model_error%" } ] } } |
SOAJS Error Codes
Code | Description |
---|---|
535 | Sub tenant cannot self invite a user |
529 | User has already been invited. |
520 | Unable to find user |
525 | Unable to generate pin at this time. |
602 | Model error: + %model_error% |
527 | username or id is required to invite user. |
Add Comment