Hi, I am Denys van Kempen, SAP Partner Innovation Lab and the SAP HANA Academy.
In this video tutorial series we are going to cover the user and team provisioning API
of SAP Analytics Cloud.
This video was recorded in September 2021; for the latest video tutorials on the topic,
please check the playlist.
In the previous video we showed how we can create users as administrator using the Security
menu and, in case we have a file in CSV format from
our user directory, we can also speed this up a bit by using the Import Users from File
feature.
We would still manually have to create our teams, and add users, and assign teams to
roles.
For larger user populations that is still a fair amount of work.
OK We also mentioned the availability of the
SAP Analytics Cloud tenant API, the User and Team Provisioning API specifically, which
enables to do all this programatically and then creating users could be as simple as
running a command: newman run,
name of the postman collection, the environment, and a CSV file with user data.
Single line of code, which you could insert into a pipeline when provisioning a new tenant,
for example.
Newman is a Node.js client provided by Postman, but of course, you could use any other language
or tool, it’s an openAPI after all.
A few statistics, three iterations, 6 requests with some test.
The script is a bit verbose for demonstration purposes, you might get it to run a little
faster.
returning to Analytics Cloud, refreshing the screen, we can see that we now have created
three users, two with a manager assigned.
What happened?
Scrolling up, first iteration, create user, a POST to the Analytics Cloud tenant SCIM
API Users endpoint returns 401 unautorized.
This sets a next request.
GET access token, a POST to the OAuth URL, the client credentials, the OAuth client Identifier
and secret come from the environment, we covered this in the previous video, then we return
to our Analytics Cloud tenant SCIM API Users endpoint for a GET request.
This is required to add an CSRF token to our header, again, as covered in the previous
video, and now we can start to create users, a POST call, returns 201 created, and then
we iterate through our CSV file until processed.
Here we are stopping after 3 iterations but you could process several thousand users this
way.
That’s it, creating users programmatically with the SAP Analytics Cloud User and Team
Provisioning API.
Should you be interested in how this works exactly, in the next video, we go through
each request in some detail, using Postman, taking a look at error handling, and also
cover updating users, creating teams, adding users to teams, deleting users, and so on.
See the description below for more information.
Don’t forget to subscribe.
Denys van Kempen, SAP HANA Academy / Partner Innovation Lab
Thanks for watching.