Access Skynamo reporting API using QLIK

Modified on Mon, 18 Mar at 3:31 PM

Welcome to the wonderful World of Skynamo Analytics!

Skynamo has a brand-new reporting API specifically designed to get your Skynamo data for the purpose of reporting.  


How to get access?


The good things in life are never free, and the same goes for access to the Skynamo Reporting.


Log a request for access with Skynamo Support ([email protected]) or your Customer Success Member. They will be able to provide you with a quote.


The following information will be required:

  • Customer Name
  • Skynamo Instance Name
  • Email address of contact person who will be working with the API connection.
  • Indication that you will be accessing the Skynamo Reporting API through Qlik.


After the above has been done, approved, and paid you will be provided with:

  • Credentials to access your Skynamo data through the reporting API (Client ID, Client Secret).


I have access, now what?


Skynamo Reporting API

For more information on using the Reporting API and examples go to the Swagger documentation:

https://analytics-api.svc.skynamo.me/swagger/index.html

Please note: To select version 2.

mceclip1.png

The provided credentials can be used in a cURL request (see below) to get an access token to Login by clicking on Authorize. Thereafter, you can try out the available GET requests.

curl --request POST \
  --url https://login.skynamo.me/oauth/token \
  --header ‘content-type: application/json’ \
  --data ‘{"client_id":"XXXX","client_secret":"XXX","audience":"https://analytics.skynamo.com/",
"grant_type":"client_credentials"}’

 

Please click here to test if the API credentials will receive information.

 

Working with the data in Qlik

Accessing Skynamo Reporting API using Qlik

  1. Open the Qlik hub, login and add a new analytics app.
    mceclip24.png
  2. Add a REST connector
    • Click on “Files and other sources”.
      mceclip5.png
    • In the search bar type in “REST” and click on the REST connector.
      mceclip26.png
  3. Complete details to create REST connection.
    • Provide the connection with a name (e.g. SkynamoUX_GetUsers).
    • Set the URL value based on the endpoint that you want to do a GET request for. The Users Endpoint example URL:


    • https://analytics-api.svc.skynamo.me/v2/users

    • Leave Method on “GET”.
    • Leave Authentication Schema on “Anonymous”.

mceclip2.png

mceclip30.png

  • Add Query parameters, as indicated in Swagger document under the Parameters section for the related endpoint. The Users Endpoint example Query Parameters:

mceclip8.png

{"entities":{"travelClaims":{"include":true},"userTimeSegments":{"include":true},"tasks":{"include":true},"userTargets":{"include":true}}}

mceclip1.png

 

  • Get an access_token using the credentials (Client ID, Client Secret) provided to access the Skynamo Reporting API. - You can use the below article to use Postman to get the access_token

    curl --request POST \
      --url https://login.skynamo.me/oauth/token \
      --header ‘content-type: application/json’ \
      --data ‘{"client_id":"XXXX","client_secret":"XXX","audience":"https://analytics.skynamo.com/",
    "grant_type":"client_credentials"}’



  • Add Query header to contain the access_token returned by the cURL request. Please note, the access_token is only valid for 24 hours.mceclip33.png
  • Add Query header to contain the access_token. The Users Endpoint example Query Headers: Authorization= Bearer <access_token returned by cURL request>mceclip1.png
  1. Click on “Test Connection” to verify that the connection is successful
    mceclip34.png
  2. Click on Create
    mceclip35.png
  3. Select the data to load and click “Next”. In this example root will contain the users data.mceclip2.pngmceclip22.png
  • Apply either the recommended associations or do them manually. This is all done in the “Prepare” tab in “Data Manager”.

    mceclip21.png
  1. Add visuals
    • Navigate to “Analyze” tab and click on “Edit sheet”

mceclip19.png

  • Add visuals from “Charts”, select data, and when ready click on “Done editing”

    mceclip3.png

  • Interact with the visuals by clicking on the chart and watch the data in the table be filtered.mceclip4.png

Handling refresh of access tokens

As mentioned in the previous section the access_token is only valid for 24 hours. The following describes a process of adding a REST connector to get the access_token and using the returned value in the REST connector implementing the GET request.

  1. Open the Qlik hub, login and add a new analytics app.mceclip5.png
  2. Add a REST connector
    • Click on “Files and other sources”. mceclip6.png
    • In the search bar type in “REST” and click on the REST connector. mceclip8.png
  3. Complete details to create REST connection.
    • Provide the connection with a name (e.g. SkynamoReportingAPI – Get Token).
    • Set the URL value as indicated in the provided cURL request:

      https://login.skynamo.me/oauth/token

    • Set the Method to “POST” and complete “Request body” as indicated:
      mceclip2.png
    • Leave Authentication Schema on “Anonymous”
    • No Query parameters are required.
    • Add Query header to contain the content-type and the value application/json
      mceclip10.png
  4. Click on “Test Connection” to verify that the connection is successful
    mceclip11.png
  5. Click on Create

  6. Update data load script of SkynamoReportingAPI – GetToken connection.
    • Click on the arrow on the Prepare tab menu item and select “Data load editor”.
    • The existing connectors are shown in the right hand “Data connections” panel. Click on the “Select data” icon for the SkynamoReportingAPI – GetToken connection.
      mceclip12.png
      Ensure that root is selected and click on “Insert script”.

      mceclip13.png
    • Add the following at the end of the script:

LET vAccessTokenValue = Peek('access_token');
trace $(vAccessTokenValue);

mceclip14.png

  1. Update data load script of SkynamoUX_GetUsers connection to dynamically set the access_token.
    • Click on the arrow on the Prepare tab menu item and select “Data load editor”.
    • The two REST connectors are shown in the right hand “Data connections” panel. Click on the “Select data” icon for the SkynamoUX_GetUsers connection.
      mceclip15.png
    • Ensure that root is selected and click on “Insert script”.
      mceclip16.png

    • Alter the SQL query to end with a ‘WITH CONNECTION’ clause to override the current connection’s settings. Add the following in the location indicated in the screenshot:

This is before the change:
mceclip4.png
Remove the below semicolon and add the 'WITH' clause

mceclip5.png

mceclip6.png

 

WITH CONNECTION (

                HTTPHEADER "Authorization" "Bearer $(vAccessTokenValue)"
);

  1. Click on “Load data” to run the changes to the script and refresh the data. mceclip18.png

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article