SAP Cloud Platform Open Connectors

Manage Users APIs

GET /users

GET /users

Retrieve a list of users in your organization. 

Query Parameters

where
The OCNQL search expression or the where clause, without the WHERE keyword, in a typical SQL query. For example, to search for accounts created on or after 'Jan 15, 2014’, the search expression will be where=createdDate >= ‘2014-01-15’. When this parameter is omitted, all accounts are returned in a paginated fashion.
nextPage
The next page token. Found in the header of the previous search
pageSize
The page size for the paginated results, defaults to 200

Response Fields

NameDescription
ID
id
The unique identifier for a user within an account. Use in any /users endpoint with an {id} variable.
Created
createdDate
The date when someone created the account.
First Name
firstName
The first name of the user.
Last Name
lastName
The last name of the user.
passwordA placeholder for the user's secure password.
Email
email
The email address of the user. The email receives all password reset emails.
Active
active
Indicates if the account is active. In the JSON response, true is active and false is inactive.
User Secret
secret
The User Secret required for API calls to SAP Cloud Platform Open Connectors APIs. You can also find your User Secret in the profile menu in SAP Cloud Platform Open Connectors.
lastLoginDateThe date that the user last logged in to SAP Cloud Platform Open Connectors, or the date that someone created the account .
fullNameThe first and last name of the user.
Org Admin/Account Admin
roles
The roles assigned to the user.

Example Request

curl -X GET \
https://api.openconnectors.us2.ext.hana.ondemand.com/elements/api-v2/users?where=active%3D%true%60&pageSize=100 \
-H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
-H 'Content-Type: application/json' \

Example Response

[  
  {  
    "id":3805,
    "createdDate":"2017-07-10",
    "firstName":"Neta",
    "password":"secured",
    "email":"Alfaro@mycompany.com",
    "active":true,
    "lastName":"Alfaro",
    "accountExpired":false,
    "accountLocked":false,
    "credentialsExpired":true,
    "lastLoginDate":"2017-07-10",
    "emailValid":true,
    "accountNonExpired":false,
    "credentialsNonExpired":false,
    "accountNonLocked":true,
    "enabled":false,
    "fullName":"Neta Alfaro"
  }
]

GET /users/{emailOrId}

GET /users/{emailOrId}

Retrieve a specific user by user id or email. 

Path Parameters

emailOrId
The id or email address associated with the user.

Header Parameters

Elements-User-PasswordOptional user password. If you include the correct password the response body includes the user secret.

Example Request

curl -X GET \
  https://api.openconnectors.us2.ext.hana.ondemand.com/elements/api-v2/users/firstlast@cloud-elements.com \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \ \
  -H 'Content-Type:application/json' \
  -H 'Elements-User-Password:password' \

Example Response

[  
  {  
    "id":160255,
    "createdDate":"2017-01-18",
    "firstName":"first",
    "email":"firstlast@cloud-elements.com",
    "active":true,
    "lastName":"last",
    "accountExpired":false,
    "accountLocked":false,
    "credentialsExpired":false,
    "secret": "wGOw+75xqzBhek=/cP8wm3SPSNggfTZp1GFLtwfYzV0r"
    "lastLoginDate":"2018-03-07",
    "accountNonLocked":true,
    "credentialsNonExpired":true,
    "accountNonExpired":true,
    "enabled":true,
    "fullName":"First Last"
  }
]

PATCH /users/{id}

PATCH /users/{id}

You can make the following updates to a user:

  • Change the password, firstName, lastName, or email .
  • Assign roles to a user.
  • Activate or deactivate a with the active parameter.

Path Parameters

userId
The id associated with a specific user.

Request Body Parameters

firstName
The first name of the user.
lastName
The last name of the user.
email
The email address of the user. The email receives all password reset emails.
password
The assigned password for the user.
roles
An object containing role assignment, which can be:
  • Organization Administrator (org-admin)
  • Account Administrator (admin)
activeDeactivate by sending "active"= false.
Activate by sending "active"= true.

Example Request

curl -X PATCH \
  https://api.openconnectors.us2.ext.hana.ondemand.com/elements/api-v2/users/178592 \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'content-type: application/json' \
  -d '{
  "firstName": "First",
  "lastName": "Last",
  "email": "firstlast@cloud-elements.com",
  "password": "password",
  "roles:[
    {
    "key": "admin"
  }
 ]
}
'

Example Response

[  
  {  
    "id":160255,
    "createdDate":"2017-01-18",
    "firstName":"first",
    "password":"secured",
    "email":"firstlast@cloud-elements.com",
    "active":true,
    "lastName":"last",
    "accountExpired":false,
    "accountLocked":false,
    "credentialsExpired":false,
    "roles":[  
    ],
    "secret": "wGOw+75xqzBhek=/cP8wm3SPSNggfTZp1GFLtwfYzV0r"
    "lastLoginDate":"2018-03-07",
    "accountNonLocked":true,
    "credentialsNonExpired":true,
    "accountNonExpired":true,
    "enabled":true,
    "fullName":"First Last"
  }
]

DELETE /users/{id}

DELETE /users/{id}

Delete a user in your organization. You cannot recover deleted users. If you think that you might need to access the user later, consider deactivating the user instead.

Path Parameters

userId
The id associated with a specific user.

Example Request

curl -X DELETE \
  https://api.openconnectors.us2.ext.hana.ondemand.com/elements/api-v2/users/161268 \
  -H 'authorization: User sAfK7LJGNz5ZHcNrvdJvLI=f03WbTbH6aRKc0HJ3oOIi, Organization 58168435e3b9959a929eb04b6218b9a2' \
  -H 'content-type: application/json' \

Example Response

The response is empty. You can confirm that you deleted the account with GET /users