You can use the user management API to create users.
Before you begin
-
Once generated, a service account token expires after 30 minutes. If it expires,
generate a new token using the POST method at the
endpoint
https://api.<env>.cloud.talend.com/security/oauth/token
.
For more information about generating a token, see Generating a service account token.
-
Ensure that the user or the service account to be
used to issue API calls has the Users - Management
permissions.
About this task
In this section, Talend API Tester is used to demonstrate how to issue API calls to create users.
Procedure
-
Open Talend API Tester in your browser and select
GET from the Method
list.
-
In the field next to the Method drop-down list, enter the
user management endpoint to be used:
https://api.<your_environment>.cloud.talend.com/scim/v2/Roles
Your environment could be:
-
In the HEADERS area, click Add
header and in the name field that is
displayed, enter Authorization and in the
value field, enter Bearer and
your token. Enter a whitespace to separate
Bearer and the token.
-
Click Send to issue your call to obtain the role ID(s)
to be assigned to the user to be created.
The response lists, in the
id
field, the roles already
defined for your Talend Cloud applications. Note down the role IDs to be assigned to
the user to be created.
The entitlement
field displays the
permission details added to a given role.
-
Select POST from the Method list and
in the field aside, enter the user management endpoint to be used:
https://api.<your_environment>.cloud.talend.com/scim/v2/Users
-
Click Add header. In the name
field that is displayed, enter Content-Type and in the
value field, enter
application/json.
-
Click Add header again and in the
name field that is displayed, enter
Authorization and in the value
field, enter Bearer and your personal access token or the
service account access token. Enter a whitespace to separate
Bearer and the token.
-
In the BODY area, enter the profile of the user to be
created.
Example
{
"schemas": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"userName": "user_name_of_your_choice, for example, ychen",
"password": "initial_password_for_this_user",
"name": {
"familyName": "family_name",
"givenName": "given_name"
},
"preferredLanguage": "en",
"timezone": "Europe/Paris",
"active": true,
"emails": [
{
"value": "example@company.com",
"display": "example@company.com",
"primary": true
}
],
"roles": [
{
"value": "3906e686-5ddd-47de-8e9f-ecae7ec9e6b2"
}
]
}
-
Click Send to issue your call.
Results
The creation is accomplished successfully and the status code 201 is returned. In
the
BODY field of the response, the details of this created user
are displayed.