Basics Exercise - Configure a Simple Extractor
It’s your turn. Configure a simple endpoint using the Extractor Builder.
Your goal is to build an extractor for Celonis’ Login History API. You can see documentation for this API by adding "swagger-ui/index.html?urls.primaryName=Team#/" after the "cloud/" of your team URL.
https://{your-team-name}.training.celonis.cloud/swagger-ui/index.html?urls.primaryName=Team#/
If you’re feeling confident, use the basic instructions. If you need a bit more guidance, then follow the step by step guide.
Basic Steps
Activate your login history by going to Admin & Settings and Login History and toggling “enable login history”. Log out and log back in once to get at least one login result. Add “/swagger-ui/index.html?urls.primaryName=Team#/” after the celonis.cloud of your Celonis Team: https://{your-team-name}.training.celonis.cloud/swagger-ui/index.html?urls.primaryName=Team#/ Build the extractor using the Login API endpoint “/api/external/authentication-events” For authentication, use OAuth. You can generate the key in your Celonis Team under Admin & Settings → Applications. Refer to documentation on OAuth for the steps. Connect to your training team. Add your login history endpoint with pagination and select “content” as your response root. Save your extractor and run your extraction in data jobs.
Step by Step STEP INSTRUCTIONS
Activate Login History
Activate your login history by going to Admin & Settings and Login History and toggling “enable login history”. Log out and log back in once to get at least one login result.
Create new extractor
In Data Integration go to any existing data pool or create one if necessary.
Create a custom extractor by clicking Connect to Data Source or Add Connection and then Create custom Rest API Extractor.
Give it a name, e.g. Login History API
Variables
On the next tab, Variables, you can keep everything as is. You only need the API URL here and it already exists.
Authentication
For authentication, take a deep breath and follow the steps below. These steps are based on OAuth developer documentation here.
Generally you need to set up your authentication and create a client ID and secret. Let's start with the authentication.
Select OAuth and Client Credentials.
Now on to the client ID and secret creation. To get the client ID and secret, open a separate tab for your team and go to Admin & Settings and then Applications. Click on + Add New Appplication and then OAuth Client.
Give it a name. Select Client secret basic. Click Define Scopes.
On the next screen, under Team, select "team.login-history:read". Click Create and save both your ID and secret in a separate file or tool (Notepad).
With your application created, you now need to give it permissions.
Go to Applications, select your new client, then Admin & Settings and activate permissions for login history.
Save and go back to your extractor builder tab.
Now adjust your Authentication on the following three points:
- Add /oauth2/token to the Get Token Endpoint field.
- Disable send request via request body.
- Add a scope key with "team.login-history:read" as the value.
Save and continue to the Data connection tab.
Data Connection
Ready to connect? Enter your training team URL up to the "cloud" along with your client ID and secret. Click on Save.
If there is an issue double check the steps in the previous step as well as whether there is an extra slash in your API URL or the Token Endpoint field.
Start endpoint.
Endpoint name and URL
In the Endpoints tab, click "Add" next to endpoint.
Call it "Login History" or a name of your choice.
Add the following endpoint to the API URL variable "api/external/authentication-events"
Click save.
Finish endpoint
Scroll down and click generate response.
Select “content” as the response root.
Copy the "pageNumber", go to Pagination above and select "Page by Page Pagination".
Enter "pageNumber" as the page parameter.
Scroll down and preview your results.
Save and click Done at the top right.
Run extraction
You can stop here but if you’re feeling motivated go ahead with an extraction.
Create a new data job based on your connection.
Add an extraction and add your table.
Run it and you are done!
Debrief
The essence of creating an extractor is to understand your API. This includes its URL, authentication, pagination, response root and more.