Connecting Power BI to Learn Amp API

Connecting Power BI to Learn Amp API

Connecting Power BI to Learn Amp API

Overview

Connect Power BI to Learn Amp using our REST API for real-time access to your learning data. This method is available to all customers and is ideal for ad-hoc queries or when you need the most current data.

💡 Tip: If you have access to the Advanced Analytics Data Warehouse (Data Lake bolt-on or Advanced package), consider using the Data Lake connection method instead — it's simpler to set up using Power BI's native Amazon Redshift connector. See Getting Started with Data Lake for details.


Functionality Breakdown

Available API Endpoints

Endpoint

Description

Scope Required

Endpoint

Description

Scope Required

/v1/activities

Learning activities (completions, progress)

activities:read

/v1/users

User data and profiles

users:read

/v1/items

Content items

items:read

/v1/teams

Team structure

teams:read

/v1/teams/:id/users

Users within a specific team

team_users:read

/v1/events

Event data

events:read

/v1/enrollments

Enrolment records

enrollments:read

/v1/channels

Channel data

channels:read

/v1/learnlists

Learnlist data

learnlists:read

/v1/tasks

Task data

tasks:read

/v1/communities

Community posts

communities_posts:read

/v1/surveys

Survey data and responses

public

/v1/verbs

Activity verb definitions

verbs:read

For full API documentation, visit developers.learnamp.com.

Authentication Flow

Learn Amp API uses OAuth 2.0 with the Client Credentials grant type:

  1. Exchange your Client ID and Secret for an access token

  2. Use the access token in API requests

  3. Tokens expire after 2 hours — refresh as needed


Pre-requisites

Role Requirements

Action

Required Role

Action

Required Role

Generate API credentials

Owner

View API credentials

Owner

Delete API credentials

Owner

⚠️ Important: Only the account Owner can manage API credentials. If you don't have Owner access, contact your Learn Amp administrator.

Technical Requirements

  • Power BI Desktop (version 2.85 or later recommended)

  • Network access to your Learn Amp API endpoint

  • A REST client tool for testing (e.g., Postman or Advanced REST Client)


Quick Start Guide

Step 1: Find Your API Base URL

Learn Amp accounts each have a unique API base URL. You'll find it in:

Company Settings → API

It looks something like https://yourcompany.learnamp.com. All API calls in this guide use {API_BASE_URL} — replace this with your actual base URL throughout.

⚠️ Do not use https://api.learnamp.com as a hardcoded base URL. Each account has its own base URL shown in the API settings page.

Step 2: Generate API Credentials

  1. Log in to Learn Amp as the Owner

  2. Click Settings in the left sidebar

  3. Navigate to Company Settings → API

  4. Click Add API Key

  5. Enter a name (e.g., "Power BI Integration")

  6. Select the required scopes (e.g., activities:read, users:read)

  7. Click Create

  8. Copy and securely store your Client ID and Client Secret

⚠️ Warning: The Client Secret is only shown once. Store it securely before closing the dialog.

Step 3: Retrieve Your Access Token

Use a REST client to retrieve your access token. See our API authentication documentation for full details.

Example request:

POST https://{API_BASE_URL}/oauth/token Content-Type: application/x-www-form-urlencoded grant_type=client_credentials &client_id=YOUR_CLIENT_ID &client_secret=YOUR_CLIENT_SECRET &scope=activities:read users:read

The response will contain your access_token. Copy this for the next step.

⚠️ Important — Scopes: If your API credentials were provisioned with specific scopes only (not the legacy public scope), you must include the scope parameter in your token request. Omitting it will cause the request to fail with invalid_scope. List all the scopes you need, space-separated.

💡 Tip: We recommend Postman or Advanced REST Client for retrieving and testing your token.

Step 4: Add a Web Data Source in Power BI

  1. Open Power BI Desktop

  2. Click Get DataWeb

  3. Select Advanced

  4. Enter the API URL, for example:

    • https://{API_BASE_URL}/v1/activities

    • https://{API_BASE_URL}/v1/users

    • https://{API_BASE_URL}/v1/tasks

  5. Under HTTP request header parameters, add:

    • Name:Authorization

    • Value:Bearer YOUR_ACCESS_TOKEN

  6. Click OK to import data

Step 5: Transform and Load

  1. Power BI will display the JSON response

  2. Click Transform Data to open Power Query Editor

  3. Expand the JSON structure into columns

  4. Apply any required transformations

  5. Click Close & Apply to load the data


FAQs

Why can't I see the API settings?

Only the Owner role can access API settings. Contact your Learn Amp administrator to request credentials or Owner access.

How do I handle pagination?

The API returns paginated results. See our guide on Handling Paginated API responses for fetching all your data.

Can I filter activities by date?

Yes! Use the filters[date][from] and filters[date][to] parameters. For example:
https://{API_BASE_URL}/v1/activities?filters[date][from]=2024-01-01

How long do access tokens last?

Access tokens expire after 2 hours. When refreshing data in Power BI, you may need to generate a new token and update the Authorization header.

My token request fails with invalid_scope — why?

Your API credentials were provisioned with specific scopes rather than the default public scope. Add a scope parameter to your token request listing all the scopes you need (e.g., scope=activities:read users:read).


Troubleshooting

Issue

Solution

Issue

Solution

401 Unauthorised

Token expired or invalid. Generate a new access token.

403 Forbidden

Missing required scope. Check your API key includes the necessary scopes.

invalid_scope error on token request

Add an explicit scope parameter to your token request. See the OAuth Scopes warning above.

Empty response

Check your filters and date ranges. Verify data exists in Learn Amp.

404 on API URL

You may be using the wrong base URL. Check Company Settings → API for your account's correct base URL.

Cannot see API settings

Ensure you have the Owner role. Contact your administrator.


Video Walkthrough

Watch our step-by-step video guide for connecting Power BI to the Learn Amp API.


Next Steps