Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this Article

...

KeyDescription
emailString. Specifies the user's email.
first_nameString. Specifes Specifies the user's first name.
last_nameString. Specifes Specifies the user's last name. 
organizationString. Specifes Specifies the name of the organization in which to place the user.
administratorBoolean. Specifies whether the user is an administrator.
allow_password_loginBoolean. 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_accessBoolean. Specifies whether the user has access to the UI. This value is set to false of service accounts.
email_notificationBoolean. Specifies whether the user receives a welcome email notification when an account is created.
created_byutilityStringBoolean. Specifies Creates 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

utilityBoolean. Creates the user as a service account.

...

as a service account.

Example

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
titleBasic Access

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

KeyDescription
first_nameString. Specifies the user's first name.
last_nameString. Specifies the user's last name.
last_nameString. Specifies the user's last name.
allow_password_loginBoolean. Specifies whether the user can login with a password.
ui_accessBoolean. Specifies whether the user has access to the UI. This value is set to false of service accounts..
allow_password_loginBoolean. Specifies whether the user can login with a password.
ui_accessBoolean. Specifies whether the user has access to the UI. This value is set to false of service accounts.
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

Examples

Paste code macro
Request:
PUT https://uat.elastic.snaplogic.com/api/1/rest/public/users/john.doe@test.com

Request Body:
{
 "email":"new.johndoe@test.com",
 "first_name":"Mr John",
 "last_name":"Doeser",
 "organization":"Test_Org2",
 "administrator":false,
 "ui_access":true,
 "allow_password_login":true,
 "create_home_directory":false
}

Response:
{
 "last_name": "Doeser", 
 "password_last_updated": "2017-01-20T11:19:55.535000+00:00", 
 "password_expired": false, 
 "allow_password_login": true, 
 "first_name": "Mr John", 
 "basic_access": null, 
 "ui_access": true, 
 "user_locked_out": false, 
 "service_account": false, 
 "email": "new.johndoe@test.com"
}

...

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

KeyDescription
membersList. Members in the group, the existing members list is overwritten.

Examples

...