In this Article
Table of Contents |
---|
maxLevel | 2 |
---|
exclude | Older Versions|Additional Resources|Related Links|Related Information |
---|
|
...
Key | Description |
---|
email | String. Specifies the user's email. |
first_name | String. Specifes the user's first name. |
last_name | String. Specifes the user's last name. |
organization | String. Specifes the name of the organization in which to place the user. |
administrator | Boolean. Specifies whether the user is an administrator. |
allow_password_login | Boolean. Specifies whether the user can login with password. |
create_home_directory | Boolean. Specifies whether a default project is to be created for the user. The path is Paste code macro |
---|
/<org_name>/projects/<first_name> <last_name> |
|
ui_access | Boolean. Specifies whether the user has access to the UI. This value is set to false of service accounts. |
email_notification | Boolean. Specifies whether the user receives a welcome email notification when an account is created. |
created_by | String. Specifies the user who originally created the service account. This parameter enables an Org admin to change the user who originally created the service account in cases where the password recovery email for that user needs to be reset. You cannot specify the current Service Account user with this parameter. - The user who calls this API must be Org admin (org_admin).
- The target user must be a service account user.
- The target user in the "created_by" value must be an Org admin of the updated user's Org.
For details, see Creating a User. |
utility | Boolean. Creates the user as a service account. |
...
Paste code macro |
---|
Request:
POST https://uat.elastic.snaplogic.com/api/1/rest/public/users
Request Body:
{
"email":"john.doe@test.com",
"first_name":"John",
"last_name":"Doe",
"organization":"Test_Org",
"administrator":false,
"ui_access":true,
"allow_password_login":true,
"create_home_directory":false
}
Response:
{
"last_name": "Doe",
"password_last_updated": "2018-11-20T09:00:18.004000+00:00",
"password_expired": false,
"allow_password_login": true,
"first_name": "John",
"basic_access": null,
"ui_access": true,
"user_locked_out": true,
"service_account": false,
"email": "john.doe@test.com",
“organizations”: [organization document, ...]
}
Organization document
{
“id”: “12345d1eiqdracdf4f8c7153”
“name”: “Test_Org”,
“administrator”: false,
} |
Info |
---|
|
The basic_access field in the returned user document records the last time (in UTC ISO-8601 format) that a user accessed the REST API using basic authentication. When the REST API is accessed for the first time, the value might be null. |
Retrieve Users by Email
Fetches user data for the specified Email.
API
Paste code macro |
---|
GET /api/1/rest/public/users/<email_address> |
Syntax
Paste code macro |
---|
REST Client:
GET https://<pod_name>/api/1/rest/public/users/<email_address>
cURL Command:
GET /api/1/rest/public/users/<email_address> HTTP/1.1
Host: <pod_name>
Authorization: Basic <bearer_token>
Cache-Control: no-cache |
Parameters
Not applicable.
Examples
...
Paste code macro |
---|
Request:
GET https://uat.elastic.snaplogic.com/api/1/rest/public/groups/Test_Org/members
Response:
{"name": "members", "members": [ "john.doe@test.com", "mary.doerina@test.com", "johnathan.doe@test.com" ] } |
Update a User
Updates data of the specified user.
API
Paste code macro |
---|
PUT /api/1/rest/public/users/<email_address> |
Syntax
Paste code macro |
---|
REST Client:
PUT https://<pod_name>/api/1/rest/public/users/<email_address>
cURL Command:
PUT /api/1/rest/public/users/<email_address> HTTP/1.1
Host: <pod_name>
Authorization: Basic <bearer_token>
Cache-Control: no-cache
Content-Type: application/json |
Parameters
Key | Description |
---|
first_name | String. Specifies the user's first name. |
last_name | String. Specifies the user's last name. |
allow_password_login | Boolean. Specifies whether the user can login with a password. |
ui_access | Boolean. Specifies whether the user has access to the UI. This value is set to false of service accounts. |
Examples
...
Deletes a user from the database. To successfully perform this action, you need to be an admin on all of the user's orgs.
Warning |
---|
This delete action permanently removes the user from the system (unlike the SnapLogic user interface that only deletes a user from the org, but not from the system). To check if a user exists in other orgs (before deleting), use the PATCH /api/1/rest/public/groups/{organization}/{name} option on the user group of your org. |
API
Paste code macro |
---|
DELETE /api/1/rest/public/users/{email} |
Syntax
Paste code macro |
---|
REST Client:
DELETE https://<pod_name>/api/1/rest/public/users/<email_address>
cURL Command:
DELETE /api/1/rest/public/users/<email_address> HTTP/1.1
Host: <pod_name>
Authorization: Basic <bearer_token>
Cache-Control: no-cache |
Parameters
Not applicable.
Examples
...
Retrieve Groups by Organization
Retrieve an Org’s groups.
API
Paste code macro |
---|
GET /api/1/rest/public/groups/<org_name> |
Syntax
Paste code macro |
---|
REST Client:
GET https://<pod_name>/api/1/rest/public/groups/<org_name>
cURL Command:
GET /api/1/rest/public/groups/<org_name> HTTP/1.1
Host: <pod_name>
Authorization: Basic <bearer_token>
Cache-Control: no-cache |
Parameters
Not applicable.
Examples
...
Paste code macro |
---|
Request:
GET https://uat.elastic.snaplogic.com/api/1/rest/public/groups/Test_Org/Test_Group
Response:
{
"name": "Test_Group",
"members": [
"john.doe@test.com",
"mary.doerina@test.com",
"johnathan.doe@test.com"
]
} |
Update Members List
Updates the members list of the specified group in the specified Org. Each time this call is executed, the members list is overwritten.
API
Paste code macro |
---|
PUT /api/1/rest/public/groups/<org_name>/<group_name> |
Syntax
Paste code macro |
---|
REST Client:
PUT https://<pod_name>/api/1/rest/public/groups/<org_name>/<group_name>
cURL Command:
PUT /api/1/rest/public/groups/<org_name>/<group_name> HTTP/1.1
Host: <pod_name>
Authorization: Basic <bearer_token>
Cache-Control: no-cache
Content-Type: application/json |
Parameters
Key | Description |
---|
members | List. Members in the group, the existing members list is overwritten. |
Examples
...