Making a connection with PowerBI

This is an overview of how to import Mopinion Form data into PowerBI.

Prerequisite

You will need API credentials to be able to make a connection with PowerBI. You can find these credentials, or generate them following this article. We will be using the API that Mopinion provides. For more information on the API, see the developer documentation.

Choosing a form that you want to import

Form ids are called datasets in the API, to get all datasets that are available you make a request to the account endpoint. For more info on how to set up a connection, see this example of a request written in Python. For our example, we will get the dataset id from the feedback form overview page in Mopinion.

When you edit the form that you want to get the data from, you’ll see this id as part of the URL:

The endpoint for the feedback data from this survey is:

1 datasets/4108/feedback

Creating the authentication header

The x-auth-token is a header that has to be sent which each request and is dependent on the body of the request and the endpoint (which is why we first determined the dataset id).

The authentication token is a Base64 encoded string, consisting of your public key, paired with an HMAC-signature. Like this:

1 BASE64( PUBLIC_KEY : HMAC.SHA256( RESOURCE_URI | JSON_BODY )

For more information, you can check the developer documentation. Because for GET requests, the request body does not change, we can generate this x-auth-token for a specific endpoint and use that in the requests we will make.

Generating the x-auth-token header can be done at the credential checker.

Use the credentials from step 1 together with the endpoint you chose from step 2 and fill these in the checker. You can leave the request body empty:

The token value will be generated for you:

Importing the dataset into PowerBI

Choose a web source as a new source for the data:

Toggle the advanced option and add the URL of the form endpoint. Add the x-auth-token together with the generated value in the HTTP request header parameters field: