NAV
Developers
cURL ruby

API Reference

Authentication Token URL

https://api.learnamp.com/oauth/token

API Base URL for subsquent calls

https://api.learnamp.com/v1

Welcome to Learn Amp API reference.

The Learn Amp API is organised around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.

Getting Started

To get started, you will need:

  1. An account on the Learn Amp platform
  2. An API Key and Secret: Go to "Company Settings" --> "API"

Please note Only the Owner user of your account is permitted to access the API settings.

Accessing API credentials for Learn Amp within Company Settings area

Authentication

Generate an Access Token from the Auth Token URL:

curl --location --request POST 'https://api.learnamp.com/oauth/token' \
--form 'client_id=YOUR-CLIENT-ID' \
--form 'client_secret=YOUR-CLIENT-SECRET' \
--form 'grant_type=client_credentials'
module Learnamp
  class Auth
    include HTTParty
    base_uri ENV['BASE_URL']

    def self.access_token
      post('/oauth/token',
           body: {
             grant_type: 'client_credentials',
             client_id: ENV['CLIENT_ID'],
             client_secret: ENV['CLIENT_SECRET']
           })
    end
  end
end

response = Learnamp::Auth.access_token
puts response["access_token"] if response.ok?

200 OK - successful response:

{
  "access_token":"abcd1234efgh5678",
  "token_type":"Bearer",
  "expires_in":7200,
  "scope":"public",
  "created_at":1601480215
}

The Learn Amp API is secured using the OAuth2 Client Credentials flow.

Before calls can be made to the API, an access token must be retrieved from the Auth Token URL.

POST https://api.learnamp.com/oauth/token

Data in Body

Parameter Value Description
client_id YOUR-CLIENT-ID API Credentials Client ID
client_secret YOUR-CLIENT-SECRET API Credentials Client Secret
grant_type client_credentials Required oath2 grant type

Subsequent API calls then require this access token to be present in an Authorization header:

Authorization: Bearer YOUR-ACCESS-TOKEN

Activities

Activity Description

In Learn Amp, an Activity describes an event that takes place on the platform. For example, User X completed Item Y, or User A started Learnlist B. All activity records are associated to a User. They contain a verb, like "logged in", "watched" etc. They have a datetime for when the activity took place.

View All Activity

View all activity in your account:

curl --location --request GET 'https://api.learnamp.com/v1/activities' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Tasks
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def all(filters)
      filters_query = URI.encode_www_form(filters)
      response = self.class.get("/activities?#{filters_query}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

filters = {
  "filters[date][from]" => "2021-12-31",
  "filters[date][to]" => "2022-02-28",
  "filters[user_id]" => 1,
  "filters[completed]" => true,
  "filters[activityable_type]" => "Item,Channel,Learnlist,Quiz",
  "filters[activityable_id]" => 99874
}
activities = Learnamp::Activities.new(token).all(filters)

View all activity

GET https://api.learnamp.com/v1/activities

Response will be paginated see pagination

Optional Filters in URL Params

The following URL params by be included, to filter the result set:

GET https://api.learnamp.com/v1/activities?expanded=true&include_deactivated_users=true&filters[date][from]=2021-01-01&filters[date][to]=2021-06-01

URL Param Example Value Description
expanded true Optional expanded json. Returns certificate and any related exercise submissions as nested data in the response. Recommend not using this option unless required.
include_deactivated_users true Optional - default is false. When true activity returned by the end-point will include activity by deactivated users.
filters[date][from] "2021-12-31" Date range FROM date in ISO 8601 format
filters[date][to] "2022-02-28" Date range TO date in ISO 8601 format
filters[timezone] "UTC" Specify Timezone by which to filter activites. See timezones.
filters[user_id] 1 User ID of user who performed the activity
filters[team_id] 78823 Filter activities to users within a particular team, specified by team_id
filters[activityable_type] "Item,Channel,Learnlist,Quiz" Type of learning object. Can be single value, or comma seperated list of types: any of Item,Channel,Learnlist,Quiz
filters[activityable_id] 99874 ID of specific learning object
filters[completed] true Only return completion activity. Useful if you only need to see what learning objects have been completed
filters[verb] "started" Return activity for a specific verb. See verbs.

200 OK - successful response:

{
    "activities": [
        {
            "id": 26338,
            "activityable": {
                "id": 461,
                "name": "User Added Content",
                "shortDescription": null,
                "type": "Item",
                "url": "https://examplecompany.learnamp.com/en/items/user-added-content",
                "addedBy": {
                    "id": 7,
                    "firstName": "Test",
                    "lastName": "User",
                    "jobTitle": "admin & ceo",
                    "email": "admin@example.com",
                    "timeZone": "London",
                    "language": "en",
                    "role": "viewer",
                    "hireDate": null,
                    "profileUrl": "https://examplecompany.learnamp.com/en/users/7",
                    "status": {
                        "status": "Not yet invited"
                    }
                },
                "displayAddedBy": null,
                "totalTimeEstimate": "< 1 hr"
            },
            "user": {
                "id": 7,
                "firstName": "Test",
                "lastName": "User",
                "jobTitle": "admin & ceo",
                "email": "admin@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "admin",
                "hireDate": null,
                "profileUrl": "https://examplecompany.learnamp.com/en/users/7",
                "status": {
                    "status": "Not yet invited"
                }
            },
            "verb": "updated",
            "createdAt": "2017-03-21T15:39:03Z",
            "expiredAt": null,
            "result": "",
            "completed": false,
            "expired": false,
            "score": null,
            "totalTime": null
        }
    ]
}

200 OK - successful response:, with expanded=true param

{
    "activities": [
        {
            "id": 29272,
            "activityable": {
                "id": 2958,
                "name": "Marketing 101",
                "shortDescription": null,
                "type": "Item",
                "url": "https://examplecompany.learnamp.com/en/items/dani",
                "addedBy": {
                    "id": 1,
                    "jobTitle": "TV Presenter & Personality",
                    "firstName": "Keith",
                    "lastName": "Chegwin",
                    "email": null,
                    "timeZone": null,
                    "language": null,
                    "role": null,
                    "profileUrl": null,
                    "status": {
                        "status": "External Contributor",
                        "time": null
                    }
                },
                "displayAddedBy": true,
                "totalTimeEstimate": "< 10 mins",
                "tags": []
            },
            "user": {
                "id": 1,
                "firstName": "Test",
                "lastName": "User",
                "jobTitle": "CTO",
                "email": "test@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "viewer",
                "hireDate": "2017-02-01",
                "profileUrl": "https://examplecompany.learnamp.com/en/users/1",
                "status": {
                    "status": "Confirmed",
                    "time": "On 29 Nov 16"
                }
            },
            "verb": "updated",
            "createdAt": "2020-08-10T13:38:21Z",
            "expiredAt": null,
            "result": "",
            "completed": false,
            "expired": false,
            "score": null,
            "totalTime": null,
            "certificate": {
                "id": 58,
                "awardedAt": "2020-08-10T13:39:01.724Z",
                "expiresAt": null,
                "certificateUrl": "https://examplecompany.learnamp.com/en/certificates/58"
            }
        }
    ]
}

Channels

Channel Description

In Learn Amp, a Channel is a collection of content (items, learnlists, events etc), arranged into a learning pathway.

View All Channels

View all channels in your account:

curl --location --request GET 'https://api.learnamp.com/v1/channels' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Channels
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def all(filters)
      filters_query = URI.encode_www_form(filters)
      response = self.class.get("/channels?#{filters_query}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

filters = {
}
teams = Learnamp::Channels.new(token).all(filters)

View all channels

GET https://api.learnamp.com/v1/channels

Response will be paginated see pagination

200 OK - successful response:

{
    "channels": [
        {
            "id": 379,
            "title": "Test Channel"
        },
  ]
}

Users Progress

View progress of all assigned users through a specified channel:

curl --location --request GET 'https://api.learnamp.com/v1/channels/123/users_progress' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Channels
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def users_progress(id)
      response = self.class.get("/channels/#{id}/users_progress", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

data = Learnamp::Channels.new(token).users_progress(123)

View progress of all assigned users through a specified channel. This is analogous to Learn Amp's Content Log feature, for a single channel.

GET https://api.learnamp.com/v1/channels/{channelId}/users_progress

This end-point will return a paginated array of users who are assigned the specified channel. Each element will contain the completion percentage of the channel by that user, as well as the datetime (if any) when the channel was completed.

Please note: Only assigned users will be returned. Users who are not assigned the specified channel will not appear in the array.

Also, please note: The completion percentage is a cached value, which is refreshed in the background automatically. The completion percentage shown may therefore take a few minutes to update.

The results are ordered alphabetically by user's last name.

Response will be paginated see pagination

200 OK - successful response:

[
    {
        "user_id": 200321,
        "first_name": "John",
        "last_name": "Abc",
        "email": "jabc@test.com",
        "content_name": "Favourites",
        "content_type": "Channel",
        "content_id": 1,
        "completed": false,
        "completion_percent": 50,
        "completed_at": null
    },
    {
        "user_id": 200018,
        "first_name": "Hannah",
        "last_name": "Baker",
        "email": "hbaker@test.com",
        "content_name": "Favourites",
        "content_type": "Channel",
        "content_id": 1,
        "completed": true,
        "completion_percent": 100,
        "completed_at": "2023-04-04T15:44:04Z"
    },
    {
        "user_id": 199915,
        "first_name": "Brian",
        "last_name": "Cross",
        "email": "bcross@test.com",
        "content_name": "Favourites",
        "content_type": "Channel",
        "content_id": 1,
        "completed": false,
        "completion_percent": 0,
        "completed_at": null
    }
]

404 Not Found - unsuccessful response when channel ID does not exist:

{
    "error": "Not found"
}

Events

Event Description

In Learn Amp, an Event is a specific type of learning object. Events have event sessions. For example the same event "Annual Christmas Party", could have multiple event sessions, one for each year.

Users are enroled to event sessions. Event sessions may have different enrolment rules - for example if space is limited, or if it is a closed event in which the user must be invited by an admin.

After an event session has been completed, the user's attendance is marked. If they attended the event session, then the event will be marked as completed for that user.

View All Events

View all events in your account:

curl --location --request GET 'https://api.learnamp.com/v1/events' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Events
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def all(filters)
      filters_query = URI.encode_www_form(filters)
      response = self.class.get("/events?#{filters_query}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

filters = {
  "filters[title]" => "Christmas Party",
  "filters[created_at][from]" => "2021-12-31",
  "filters[created_at][to]" => "2022-02-28",
}
tasks = Learnamp::Events.new(token).all(filters)

View all events

GET https://api.learnamp.com/v1/events

Response will be paginated see pagination

Optional Filters in URL Params

The following URL params by be included, to filter the result set:

GET https://api.learnamp.com/v1/events?filters[created_at][from]=2021-01-01&filters[created_at][to]=2021-06-01

URL Param Example Value Description
filters[title] "Christmas Party" Search event title
filters[created_at][from] "2021-12-31" Created at date range FROM date in ISO 8601 format.
filters[created_at][to] "2022-02-28" Created at date range TO date in ISO 8601 format

200 OK - successful response:

{
    "events": [
        {
            "id": 75,
            "name": "some incoming event",
            "shortDescription": null,
            "createdAt": "2019-09-20T11:00:26.464Z",
            "updatedAt": "2019-09-20T11:02:21.012Z",
            "eventUrl": "https://examplecompany.learnamp.com/en/events/some-incoming-event",
            "eventSessionsCount": 1
        },
        {
            "id": 74,
            "name": "not yet cancelled event",
            "shortDescription": null,
            "createdAt": "2019-09-09T10:24:23.755Z",
            "updatedAt": "2019-09-09T10:28:45.997Z",
            "eventUrl": "https://examplecompany.learnamp.com/en/events/not-yet-cancelled-event",
            "eventSessionsCount": 3
        },
        {
            "id": 73,
            "name": "event enrolled by manager",
            "shortDescription": null,
            "createdAt": "2019-09-06T13:36:17.667Z",
            "updatedAt": "2019-09-06T13:36:32.801Z",
            "eventUrl": "https://examplecompany.learnamp.com/en/events/event-enrolled-by-manager",
            "eventSessionsCount": 0
        },
    ]
}

Show an Event and it's Event Sessions

Display details for a single event:

curl --location --request GET 'https://api.learnamp.com/v1/events/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Events
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def find(id)
      response = self.class.get("/events/#{id}", { headers: headers })
      response.parsed_response if response.ok?
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

event = Learnamp::Events.new(token).find(1)

Display user details for one specific event.

GET https://api.learnamp.com/v1/event/{eventId}

200 OK - successful response:

{
    "id": 75,
    "name": "some incoming event",
    "shortDescription": null,
    "createdAt": "2019-09-20T11:00:26.464Z",
    "updatedAt": "2019-09-20T11:02:21.012Z",
    "eventUrl": "https://examplecompany.learnamp.com/en/events/some-incoming-event",
    "createdBy": {
        "id": 718,
        "firstName": "Test",
        "lastName": "User",
        "jobTitle": "Sales Director",
        "email": "viewer@example.com",
        "timeZone": "London",
        "language": "en",
        "role": "viewer",
        "hireDate": null,
        "profileUrl": "https://examplecompany.learnamp.com/en/users/718",
        "status": {
            "status": "Confirmed",
            "time": "On 23 Mar 18"
        }
    },
    "visibility": "Entire Company",
    "ratingsCount": 0,
    "averageRating": 0.0,
    "expiresAt": null,
    "goesLiveAt": null,
    "eventSessions": [
        {
            "id": 56,
            "createdAt": "2019-09-20T11:02:20.778Z",
            "updatedAt": "2019-09-20T11:02:20.778Z",
            "startsAt": "2019-09-20T12:00:00.000Z",
            "endsAt": "2019-09-20T13:00:00.000Z",
            "locationType": "plain_text",
            "locationAddress": "Gliwice, HQ, akwarium",
            "host": null,
            "eventId": 75,
            "enrollmentsCount": 0,
            "enrollmentType": "user",
            "enrollmentDeadline": null
        }
    ],
    "tags": []
}

404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Enrollments

Enrollment Description

In Learn Amp, an Enrollment is the association between a user and an event session. Users may be enrolled into various event sessions. Their enrollment may be marked as attended or not attended after the event session has ended. If an enrollment is set to "attended", an activity record will be created, in which the user is marked as having completed the associated event.

View All Enrollments

View all event session enrollments in your account:

curl --location --request GET 'https://api.learnamp.com/v1/enrollments' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Enrollments
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def all(filters)
      filters_query = URI.encode_www_form(filters)
      response = self.class.get("/enrollments?#{filters_query}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

filters = {
  "filters[event_id]" => 4,
  "filters[event_session_id]" => 2,
  "filters[attendance]" => "attended"
}
tasks = Learnamp::Enrollments.new(token).all(filters)

View all events

GET https://api.learnamp.com/v1/enrollments

Response will be paginated see pagination

Optional Filters in URL Params

The following URL params by be included, to filter the result set:

GET https://api.learnamp.com/v1/enrollments?filters[created_at][from]=2021-01-01&filters[created_at][to]=2021-06-01

URL Param Example Value Description
filters[event_id] 4 ID of specific event
filters[status] approved Status of enrollment. Must be one of "pending", "approved", "rejected", "unenrolled"
filters[created_at][from] 2020-06-01 Enrollment creation date range FROM in ISO 8601 date format
filters[created_at][to] 2020-07-01 Enrollment creation date range TO in ISO 8601 date format
filters[event_session_starts_at][from] 2020-05-01 Event session START date range FROM in ISO 8601 date format
filters[event_session_starts_at][to] 2020-07-01 Event session START date range TO in ISO 8601 date format
filters[event_session_ends_at][from] 2020-05-01 Event session END date range FROM in ISO 8601 date format
filters[event_session_ends_at][to] 2020-07-01 Event session END date range TO in ISO 8601 date format
filters[event_session_id] 71 ID of a specific event session
filters[enrolled_at][from] 2020-05-01 Date when enrollent status was set to "approved", range FROM value in ISO 8601 date format
filters[enrolled_at][to] 2020-06-10 Date when enrollent status was set to "approved", range TO value in ISO 8601 date format
filters[attendance] attended Attendance setting, one of "marked_not_yet", "attended", "did_not_attend"
filters[updated_at][from] 2020-04-01 Enrollment updated date range FROM in ISO 8601 date format
filters[updated_at][to] 2020-04-01 Enrollment updated date range TO in ISO 8601 date format

200 OK - successful response:

{
    "enrollments": [
        {
            "id": 52,
            "createdAt": "2019-05-06T09:28:52.079Z",
            "updatedAt": "2019-05-07T07:01:42.016Z",
            "enrolledAt": null,
            "status": "pending",
            "attendance": "Attended",
            "isHost": false,
            "user": {
                "id": 7,
                "firstName": "John",
                "lastName": "Test",
                "jobTitle": "admin & ceo",
                "email": "admin@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "super_admin",
                "hireDate": null,
                "profileUrl": "https://examplecompany.learnamp.com/en/users/7",
                "status": {
                    "status": "Not yet invited"
                }
            },
            "enrolledBy": {
                "id": 7,
                "firstName": "John",
                "lastName": "Test",
                "jobTitle": "admin & ceo",
                "email": "admin@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "super_admin",
                "hireDate": null,
                "profileUrl": "https://examplecompany.learnamp.com/en/users/7",
                "status": {
                    "status": "Not yet invited"
                }
            },
            "eventSession": {
                "id": 5,
                "createdAt": "2018-12-18T13:15:26.401Z",
                "updatedAt": "2019-05-06T09:25:48.325Z",
                "startsAt": "2019-05-12T12:05:00.000Z",
                "endsAt": "2019-05-12T13:05:00.000Z",
                "locationType": "plain_text",
                "locationAddress": "france",
                "host": null,
                "enrollmentsCount": 1,
                "enrollmentType": "admin_approved",
                "enrollmentDeadline": null,
                "spaces": 30,
                "event": {
                    "id": 4,
                    "name": "event in france",
                    "shortDescription": null,
                    "createdAt": "2018-12-18T13:15:26.381Z",
                    "updatedAt": "2019-05-06T09:25:48.354Z",
                    "eventUrl": "https://examplecompany.learnamp.com/en/events/d3b96c0b-1665-4e6f-9b8d-5bdfadcd0807",
                    "eventSessionsCount": 1
                }
            }
        }
    ]
}

Show an Event and it's Event Sessions

Display details for a single event:

curl --location --request GET 'https://api.learnamp.com/v1/events/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Events
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def find(id)
      response = self.class.get("/events/#{id}", { headers: headers })
      response.parsed_response if response.ok?
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

event = Learnamp::Events.new(token).find(1)

Display user details for one specific event.

GET https://api.learnamp.com/v1/event/{eventId}

200 OK - successful response:

{
    "enrollments": [
        {
            "id": 52,
            "createdAt": "2019-05-06T09:28:52.079Z",
            "updatedAt": "2019-05-07T07:01:42.016Z",
            "enrolledAt": null,
            "status": "pending",
            "attendance": "Attended",
            "isHost": false,
            "user": {
                "id": 7,
                "firstName": "John",
                "lastName": "Test",
                "jobTitle": "admin & ceo",
                "email": "admin@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "super_admin",
                "hireDate": null,
                "profileUrl": "https://examplecompany.learnamp.com/en/users/7",
                "status": {
                    "status": "Not yet invited"
                }
            },
            "enrolledBy": {
                "id": 7,
                "firstName": "John",
                "lastName": "Test",
                "jobTitle": "admin & ceo",
                "email": "admin@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "super_admin",
                "hireDate": null,
                "profileUrl": "https://examplecompany.learnamp.com/en/users/7",
                "status": {
                    "status": "Not yet invited"
                }
            },
            "eventSession": {
                "id": 5,
                "createdAt": "2018-12-18T13:15:26.401Z",
                "updatedAt": "2019-05-06T09:25:48.325Z",
                "startsAt": "2019-05-12T12:05:00.000Z",
                "endsAt": "2019-05-12T13:05:00.000Z",
                "locationType": "plain_text",
                "locationAddress": "france",
                "host": null,
                "enrollmentsCount": 1,
                "enrollmentType": "admin_approved",
                "enrollmentDeadline": null,
                "spaces": 30,
                "event": {
                    "id": 4,
                    "name": "event in france",
                    "shortDescription": null,
                    "createdAt": "2018-12-18T13:15:26.381Z",
                    "updatedAt": "2019-05-06T09:25:48.354Z",
                    "eventUrl": "https://examplecompany.learnamp.com/en/events/d3b96c0b-1665-4e6f-9b8d-5bdfadcd0807",
                    "eventSessionsCount": 1
                }
            }
        }
    ]
}

Show an Enrollment

Display details for a single enrollment:

curl --location --request GET 'https://api.learnamp.com/v1/enrollments/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Users
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def find(id)
      response = self.class.get("/enrollments/#{id}", { headers: headers })
      response.parsed_response if response.ok?
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

enrollment = Learnamp::Enrollments.new(token).find(1)

Display user details for one specific user.

GET https://api.learnamp.com/v1/enrollments/{enrollmentId}

200 OK - successful response:

{
    "id": 52,
    "createdAt": "2019-05-06T09:28:52.079Z",
    "updatedAt": "2019-05-07T07:01:42.016Z",
    "enrolledAt": null,
    "status": "approved",
    "attendance": "Attended",
    "isHost": false,
    "user": {
        "id": 7,
        "firstName": "John",
        "lastName": "Test",
        "jobTitle": "admin & ceo",
        "email": "admin@example.com",
        "timeZone": "London",
        "language": "en",
        "role": "super_admin",
        "hireDate": null,
        "profileUrl": "https://examplcompany.learnamp.com/en/users/7",
        "status": {
            "status": "Not yet invited"
        }
    },
    "enrolledBy": {
        "id": 7,
        "firstName": "John",
        "lastName": "Test",
        "jobTitle": "admin & ceo",
        "email": "admin@example.com",
        "timeZone": "London",
        "language": "en",
        "role": "super_admin",
        "hireDate": null,
        "profileUrl": "https://examplcompany.learnamp.com/en/users/7",
        "status": {
            "status": "Not yet invited"
        }
    },
    "eventSession": {
        "id": 5,
        "createdAt": "2018-12-18T13:15:26.401Z",
        "updatedAt": "2019-05-06T09:25:48.325Z",
        "startsAt": "2019-05-12T12:05:00.000Z",
        "endsAt": "2019-05-12T13:05:00.000Z",
        "locationType": "plain_text",
        "locationAddress": "france",
        "host": null,
        "enrollmentsCount": 1,
        "enrollmentType": "admin_approved",
        "enrollmentDeadline": null,
        "spaces": 30,
        "event": {
            "id": 4,
            "name": "event in france",
            "shortDescription": null,
            "createdAt": "2018-12-18T13:15:26.381Z",
            "updatedAt": "2019-05-06T09:25:48.354Z",
            "eventUrl": "https://examplcompany.learnamp.com/en/events/d3b96c0b-1665-4e6f-9b8d-5bdfadcd0807",
            "eventSessionsCount": 1
        }
    }
}

404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Tasks

Task Description

In Learn Amp, a Task is a piece of learning content that a user is given a specific deadline to complete.

A task has an assigner - the person who set the task. It also has a setFor user - the person required to complete the task.

Tasks may be mandatory. Tasks always have a deadline, and are associated to a specific learning object, referred to as "taskable" in json reponses.

Tasks may be completed by the user, or they may still be pending/overdue.

Tasks may be expired, for example, if the same user is required to complete the same content every year. When the new task is assigned for the same user, their previous task to complete the same content is marked as expired.

View All Tasks

View all tasks in your account:

curl --location --request GET 'https://api.learnamp.com/v1/tasks' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Tasks
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def all(filters)
      filters_query = URI.encode_www_form(filters)
      response = self.class.get("/tasks?#{filters_query}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

filters = {
  "filters[assigned_at][from]" => "2021-12-31",
  "filters[assigned_at][to]" => "2022-02-28",
  "filters[completed_at][from]" => "2021-12-31",
  "filters[completed_at][to]" => "2022-02-28",
  "filters[deadline][from]" => "2021-12-31",
  "filters[deadline][to]" => "2022-02-28",
  "filters[created_at][from]" => "2021-12-31",
  "filters[created_at][to]" => "2022-02-28",
  "filters[update_at][from]" => "2021-12-31",
  "filters[update_at][to]" => "2022-02-28",
  "filters[id]" => 2456,
  "filters[user_id]" => 1,
  "filters[taskable_type]" => "Item,Channel,Learnlist,Quiz",
  "filters[taskable_id]" => 99874,
  "filters[status]" => "completed"
}
tasks = Learnamp::Tasks.new(token).all(filters)

View all tasks

GET https://api.learnamp.com/v1/tasks

Response will be paginated see pagination

Optional Filters in URL Params

The following URL params by be included, to filter the result set:

GET https://api.learnamp.com/v1/tasks?filters[deadline][from]=2021-01-01&filters[deadline][to]=2021-06-01

URL Param Example Value Description
expanded true Optional expanded data. Will include related exercise submissions, and awarded certificates. Using this option is NOT recommended, unless required.
filters[assigned_at][from] "2021-12-31" Assigned date range FROM date in ISO 8601 format
filters[assigned_at][to] "2022-02-28" Assigned date range TO date in ISO 8601 format
filters[completed_at][from] "2021-12-31" Completion date range FROM date in ISO 8601 format
filters[completed_at][to] "2022-02-28" Completion date range TO date in ISO 8601 format
filters[deadline][from] "2021-12-31" Deadline date range FROM date in ISO 8601 format
filters[deadline][to] "2022-02-28" Deadline date range TO date in ISO 8601 format
filters[created_at][from] "2021-12-31" Created at date range FROM date in ISO 8601 format. Tasks may be created before they are actually assigned to the user.
filters[created_at][to] "2022-02-28" Created at date range TO date in ISO 8601 format
filters[update_at][from] "2021-12-31" Updated at date range FROM date in ISO 8601 format
filters[update_at][to] "2022-02-28" Updated at date range TO date in ISO 8601 format
filters[id] 2456 ID of specific task
filters[user_id] 78823 User ID of person assigned the task
filters[taskable_type] "Item,Channel,Learnlist,Quiz" Type of learning object. Can be single value, or comma seperated list of Task types: any of Item,Channel,Learnlist,Quiz
filters[taskable_id] 99874 ID of specific learning object
filters[status] "completed" Task status. One of: completed / overdue / incomplete

200 OK - successful response:

{
    "tasks": [
        {
            "id": 4428,
            "taskableId": 634,
            "taskableType": "Item",
            "createdAt": "2021-02-24T15:52:59Z",
            "deadline": "2021-02-28",
            "expiredAt": null,
            "assignedAt": "2021-02-24T15:52:59Z",
            "completedAt": null,
            "name": "Landing Page Design & Web Design Fundamentals",
            "taskable": {
                "id": 634,
                "name": "Landing Page Design & Web Design Fundamentals",
                "shortDescription": null,
                "type": "Item",
                "url": "https://testaccount.learnamp.com/en/items/landing-page-design",
                "addedBy": {
                    "id": 1,
                    "firstName": "Test",
                    "lastName": "User",
                    "jobTitle": "Tester",
                    "email": "test@example.com",
                    "timeZone": "London",
                    "language": "en",
                    "role": "viewer",
                    "profileUrl": "https://testaccount.learnamp.com/en/users/1",
                    "status": {
                        "status": "Confirmed",
                        "time": "On 29 Nov 16"
                    }
                },
                "displayAddedBy": true,
                "totalTimeEstimate": "1-10 hrs"
            },
            "typeLabel": "Course",
            "overdue": true,
            "mandatory": false,
            "completed": false,
            "expired": false,
            "setFor": {
                "id": 123,
                "firstName": "Andy",
                "lastName": "Jones",
                "jobTitle": "Customer Success Executive",
                "email": "andy@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "viewer",
                "profileUrl": "https://testaccount.learnamp.com/en/users/123",
                "status": {
                    "status": "Confirmed",
                    "time": "On 15 Oct 20"
                }
            },
            "url": "https://testaccount.learnamp.com/en/items/landing-page-design-web-design-fundamentals-2017",
            "assigner": {
                "id": 1,
                "firstName": "Admin",
                "lastName": "User",
                "jobTitle": "Boss",
                "email": "adminuser@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "admin",
                "profileUrl": "https://testaccount.learnamp.com/en/users/1",
                "status": {
                    "status": "Confirmed",
                    "time": "On 29 Nov 16"
                }
            }
        }
    ]
}

200 OK - successful response, woth optional expanded=true param

{
    "tasks": [
        {
            "id": 4169,
            "taskableId": 2958,
            "taskableType": "Item",
            "createdAt": "2020-08-10T13:38:50Z",
            "deadline": "2020-08-21",
            "expiredAt": null,
            "assignedAt": "2020-08-10T13:38:50Z",
            "completedAt": "2020-08-10T13:39:01Z",
            "name": "Marketing 101",
            "taskable": {
                "id": 2958,
                "name": "Marketing 101",
                "shortDescription": null,
                "type": "Item",
                "url": "https://examplecompany.learnamp.com/en/items/dani",
                "addedBy": {
                    "id": 1,
                    "jobTitle": "TV Presenter & Personality",
                    "firstName": "Keith",
                    "lastName": "Chegwin",
                    "email": null,
                    "timeZone": null,
                    "language": null,
                    "role": null,
                    "profileUrl": null,
                    "status": {
                        "status": "External Contributor",
                        "time": null
                    }
                },
                "displayAddedBy": true,
                "totalTimeEstimate": "< 10 mins",
                "tags": []
            },
            "typeLabel": "Video",
            "overdue": true,
            "mandatory": true,
            "completed": true,
            "expired": false,
            "setFor": {
                "id": 1,
                "firstName": "Test",
                "lastName": "User",
                "jobTitle": "Tester",
                "email": "test@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "viewer",
                "hireDate": "2017-02-01",
                "profileUrl": "https://examplecompany.learnamp.com/en/users/1",
                "status": {
                    "status": "Confirmed",
                    "time": "On 29 Nov 16"
                }
            },
            "url": "https://examplecompany.learnamp.com/en/items/dani",
            "assigner": {
                "id": 1,
                "firstName": "Test",
                "lastName": "User",
                "jobTitle": "CTO",
                "email": "test@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "viewer",
                "hireDate": "2017-02-01",
                "profileUrl": "https://examplecompany.learnamp.com/en/users/1",
                "status": {
                    "status": "Confirmed",
                    "time": "On 29 Nov 16"
                }
            },
            "certificate": {
                "id": 58,
                "awardedAt": "2020-08-10T13:39:01.724Z",
                "expiresAt": null,
                "certificateUrl": "https://examplecompany.learnamp.com/en/certificates/58"
            },
            "score": 100,
            "totalTime": 180
        }
    ]
}

Teams

Team Description

In Learn Amp, a Team is any grouping of users. Teams may map to your organisation (e.g "Sales Department"), or they may be learning teams (e.g. "Trainee Managers").

View All Teams

View all teams in your account:

curl --location --request GET 'https://api.learnamp.com/v1/teams' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Teams
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def all(filters)
      filters_query = URI.encode_www_form(filters)
      response = self.class.get("/teams?#{filters_query}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

filters = {
  "filters[name]": "marketing"
}
teams = Learnamp::Teams.new(token).all(filters)

View all teams

GET https://api.learnamp.com/v1/teams

Response will be paginated see pagination

Optional Filters in URL Params

The following URL params by be included, to filter the result set:

GET https://api.learnamp.com/v1/teams?filters[name]=founders

URL Param Value Description
filters[name] "Team name" Return team with matching name
filters[tags] "developers,product,compliance" Return teams matching any of the given tags. Use comma seperated string.

200 OK - successful response:

{
    "teams": [
        {
            "id": 379,
            "name": "Test Team",
            "teamUsersCount": 2,
            "apiTeamPath": "/v1/teams/379.json",
            "apiTeamUsersPath": "/v1/teams/379/users.json",
            "parentTeamId": 123,
            "manager": {
                "id": 7,
                "firstName": "Test",
                "lastName": "Manager",
                "jobTitle": "Ops Director",
                "email": "admin@example.com",
                "timeZone": "London",
                "language": "en",
                "role": "admin",
                "profileUrl": "http://testaccount.learnamp.com/en/users/7",
                "status": {
                    "status": "Invite pending",
                    "time": "Sent 25 Sep 19"
                }
            },
            "secondaryManagers": [
                {
                    "id": 8,
                    "firstName": "Test2",
                    "lastName": "Secondary",
                    "jobTitle": "Vice director",
                    "email": "admin2@example.com",
                    "timeZone": "London",
                    "language": "en",
                    "role": "admin",
                    "profileUrl": "http://testaccount.learnamp.com/en/users/8",
                    "status": {
                      "status": "Invite pending",
                      "time": "Sent 25 Sep 19"
                    }
                }
            ]
        },
  ]
}

Show a Team

Display details for a single Team:

curl --location --request GET 'https://api.learnamp.com/v1/teams/383' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Teams
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def find(id)
      response = self.class.get("/teams/#{id}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

teams = Learnamp::Teams.new(token).find(245)

Display details for one specific Team.

GET https://api.learnamp.com/v1/teams/{teamId}

200 OK - successful response:

{
    "id": 383,
    "name": "Test Team",
    "teamUsersCount": 2,
    "apiTeamPath": "/v1/teams/383.json",
    "apiTeamUsersPath": "/v1/teams/383/users.json",
    "manager": {
        "id": 7,
        "firstName": "Test",
        "lastName": "Manager",
        "jobTitle": "Ops Director",
        "email": "admin@example.com",
        "timeZone": "London",
        "language": "en",
        "role": "admin",
        "profileUrl": "https://testaccount.learnamp.com/en/users/7",
        "status": {
            "status": "Invite pending",
            "time": "Sent 25 Sep 19"
        }
    },
    "secondaryManagers": [
        {
            "id": 8,
            "firstName": "Test2",
            "lastName": "Secondary",
            "jobTitle": "Vice director",
            "email": "admin2@example.com",
            "timeZone": "London",
            "language": "en",
            "role": "admin",
            "profileUrl": "http://testaccount.learnamp.com/en/users/8",
            "status": {
              "status": "Invite pending",
              "time": "Sent 25 Sep 19"
            }
        }
    ],
    "users": [
        {
            "id": 1186,
            "firstName": "Test",
            "lastName": "User2",
            "jobTitle": "Customer Retention Manager",
            "email": "testuser2@example.com",
            "timeZone": "London",
            "language": "en",
            "role": "viewer",
            "profileUrl": "https://testaccount.learnamp.com/en/users/1186",
            "status": {
                "status": "Confirmed",
                "time": "On 4 Mar 20"
            },
            "removeFromTeamUrl": "/v1/teams/383/users/1186.json"
        },
        {
            "id": 1281,
            "firstName": "Test",
            "lastName": "User",
            "jobTitle": "Sales director",
            "email": "testuser@example.com",
            "timeZone": "London",
            "language": "en",
            "role": "admin",
            "profileUrl": "https://testaccount.learnamp.com/en/users/1281",
            "status": {
                "status": "Confirmed",
                "time": "On 3 Mar 20"
            },
            "removeFromTeamUrl": "/v1/teams/383/users/1281.json"
        }
    ],
    "subTeams": [
        {
            "id": 169,
            "name": "Middle team",
            "teamUsersCount": 2,
            "parentTeamId": 383,
            "apiTeamPath": "/v1/teams/169.json",
            "apiTeamUsersPath": "/v1/teams/169/users.json",
            "manager": null,
            "secondaryManagers": []
        }
    ],
    "parentTeam": {
        "id": 1,
        "name": "Super team",
        "teamUsersCount": 2,
        "parentTeamId": null,
        "apiTeamPath": "/v1/teams/1.json",
        "apiTeamUsersPath": "/v1/teams/1/users.json",
        "manager": null,
        "secondaryManagers": []
    },
    "tags": [
      "example team tag 1",
      "example team tag 2"
    ],
}

404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Create a Team

Create a new Team:

curl --location --request POST 'https://api.learnamp.com/v1/teams' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'name=New Team Test' \
--form 'managerId=1' \
--form 'parentTeamId=1200'
curl --location --request POST 'https://api.learnamp.com/v1/teams' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'name=New Team Test' \
--form 'managerEmail=manager@company.com' \
--form 'parentTeamName=Marketing'
module Learnamp
  class Teams
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def create(params)
      response = self.class.post("/teams", { body: params, headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

params = {
  name: "Sales",
  managerId: 1,
  parentTeamId: 245,
  tags: "sales,account management,cold calling"
}

team = Learnamp::Teams.new(token).create(params)

Create a Team

POST https://api.learnamp.com/v1/teams

Data in Body

Parameter (* required) Example value Description
name * Sales Name of team
managerId 1 User ID of Team Manager
managerEmail "manager@email.com" Email of Team Manager
secondaryManagerIds [2, 3] IDs of Secondary Managers
parentTeamId 10 ID of the parent team
parentTeamName "Marketing" Name of the parent team
subTeamIds [1000, 1200] IDs of sub-teams
subTeamNames ["Tech", "HR"] Names of sub-teams
tags "developers,product,compliance" Tags - comma seperated string

Parameters managerId and managerEmail are mutually exclusive - endpoint expects to receive only one of those. Same rule applies for parentTeamId - parentTeamName and subTeamIds - subTeamNames.

201 Created - successful response:

{
    "id": 449,
    "name": "New Team Test",
    "teamUsersCount": 0,
    "apiTeamPath": "/v1/teams/449.json",
    "apiTeamUsersPath": "/v1/teams/449/users.json",
    "manager": {
        "id": 1,
        "firstName": "Test",
        "lastName": "User",
        "jobTitle": "Sales Manager",
        "email": "test@example.com",
        "timeZone": "London",
        "language": "en",
        "role": "viewer",
        "profileUrl": "http://testaccount.learnamp.com/en/users/1",
        "status": {
            "status": "Confirmed",
            "time": "On 29 Nov 16"
        }
    },
    "secondaryManagers": [],
    "users": [],
    "parentTeam": {
        "id": 10,
        "name": "Super team",
        "teamUsersCount": 2,
        "parentTeamId": null,
        "apiTeamPath": "/v1/teams/10.json",
        "apiTeamUsersPath": "/v1/teams/10/users.json",
        "manager": null,
        "secondaryManagers": []
    },
    "subTeams": [],
    "tags": []
}

400 Bad request - validation errors:

{
    "error": "name is missing, name is empty, parentTeamId must match existing teams IDs",
    "fullErrors": {
        "name": [
            "is missing",
            "is empty"
        ],
        "parentTeamId": [
            "must match existing teams IDs"
        ]
    }
}

Update a Team

Update a team:

curl --location --request PUT 'https://api.learnamp.com/v1/teams/383' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'name=New Team Name' \
--form 'managerId=1'
module Learnamp
  class Teams
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def update(id, params)
      response = self.class.put("/teams/#{id}", { body: params, headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

team = Learnamp::Teams.new(token).update(456, params)

Update a Team

PUT https://api.learnamp.com/v1/items

Data in Body

Parameter Example value Description
name Marketing Team Name
managerId 1 User ID of Team Manager
parentTeamId 10 ID of the parent team
tags "developers,product,compliance" Tags - comma seperated string

200 OK - successful response:

{
    "id": 383,
    "name": "New Team Name",
    "teamUsersCount": 0,
    "apiTeamPath": "/v1/teams/383.json",
    "apiTeamUsersPath": "/v1/teams/383/users.json",
    "manager": {
        "id": 1,
        "firstName": "Test",
        "lastName": "User",
        "jobTitle": "Sales Manager",
        "email": "test@example.com",
        "timeZone": "London",
        "language": "en",
        "role": "viewer",
        "profileUrl": "http://testaccount.learnamp.com/en/users/1",
        "status": {
            "status": "Confirmed",
            "time": "On 29 Nov 16"
        }
    },
    "secondaryManagers": [],
    "users": [],
    "parentTeam": {
        "id": 10,
        "name": "Super team",
        "teamUsersCount": 2,
        "parentTeamId": null,
        "apiTeamPath": "/v1/teams/10.json",
        "apiTeamUsersPath": "/v1/teams/10/users.json",
        "manager": null,
        "secondaryManagers": []
    },
    "subTeams": [],
    "tags": []
}

400 Bad request - validation errors:

{
    "error": "name is missing, name is empty",
    "fullErrors": {
        "name": [
            "is missing",
            "is empty"
        ]
    }
}

Delete a Team

Delete a team:

curl --location --request DELETE 'https://api.learnamp.com/v1/teams/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Teams
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def delete(id)
      response = self.class.delete("/teams/#{id}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

Learnamp::Teams.new(token).delete(456)

Delete a team. (Users are kept, but their association with team is removed).

DELETE https://api.learnamp.com/v1/teams/{teamId}

204 No Content - successful response:


404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Team Users

View all users in a Team

View all users in a specific team:

curl --location --request GET 'https://api.learnamp.com/v1/teams/1/users' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class TeamUsers
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def find(team_id)
      response = self.class.get("/teams/#{team_id}/users", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

users = Learnamp::TeamUsers.new(token).find(245)

View a specific team, and include all users in that team.

GET https://api.learnamp.com/v1/teams/{teamId}/users

200 OK - successful response:

{

  "id": 379,
  "name": "Test Team",
  "teamUsersCount": 2,
  "apiTeamPath": "/v1/teams/379.json",
  "apiTeamUsersPath": "/v1/teams/379/users.json",
  "manager": {
      "id": 7,
      "firstName": "Test",
      "lastName": "Manager",
      "jobTitle": "Ops Director",
      "email": "admin@example.com",
      "timeZone": "London",
      "language": "en",
      "role": "admin",
      "profileUrl": "http://testaccount.learnamp.com/en/users/7",
      "status": {
          "status": "Invite pending",
          "time": "Sent 25 Sep 19"
      }
  },
  "users": [
        {
          "id": 1,
          "firstName": "Test",
          "lastName": "User",
          "jobTitle": "Developer",
          "email": "test@email.com",
          "timeZone": "London",
          "language": "en",
          "role": "viewer",
          "profileUrl": "https://testaccount.learnamp.com/en/users/1",
          "status": {
              "status": "Confirmed",
              "time": "On 29 Nov 16"
          },
          "avatar": "AVATAR_IMAGE_URL",
          "manager": {
              "id": 17,
              "firstName": "Manager",
              "lastName": "User",
              "jobTitle": "Head of Ops",
              "email": "testuser2@email.com",
              "timeZone": "New York",
              "language": "en-US",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                  "status": "Confirmed",
                  "time": "On 20 Feb 17"
              }
          },
          "location": "London, UK",
          "primaryTeam": {
            "id": 15,
            "name": "Operations",
            "teamUsersCount": 10,
            "apiTeamPath": "/v1/teams/15.json",
            "apiTeamUsersPath": "/v1/teams/15/users.json",
            "manager": {
              "id": 17,
              "firstName": "Manager",
              "lastName": "User",
              "jobTitle": "Head of Ops",
              "email": "testuser2@email.com",
              "timeZone": "New York",
              "language": "en-US",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                "status": "Confirmed",
                "time": "On 20 Feb 17"
              }
            }
          },
          "secondaryTeams": []
        },
      ]
    }
  ]
}

Add a User to a Team

Add a user to a team:

curl --location --request POST 'https://api.learnamp.com/v1/teams/1/users' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'userId=1'
module Learnamp
  class TeamUsers
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def create(team_id, params)
      response = self.class.post("/teams/#{team_id}/users", { body: params, headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

params = {
  userId: 1
}

Learnamp::TeamUsers.new(token).create(245, params)

Adds a user to a Team.

POST https://api.learnamp.com/v1/teams/{teamId}/users

Note that Team ID is passed in as a URL segment.

Data in Body

Parameter Example value Description (* required)
userId 1 User ID of user to add to team

201 Created - successful response:

```json
{

  "id": 1,
  "name": "Test Team",
  "teamUsersCount": 2,
  "apiTeamPath": "/v1/teams/1.json",
  "apiTeamUsersPath": "/v1/teams/1/users.json",
  "manager": {
      "id": 7,
      "firstName": "Test",
      "lastName": "Manager",
      "jobTitle": "Ops Director",
      "email": "admin@example.com",
      "timeZone": "London",
      "language": "en",
      "role": "admin",
      "profileUrl": "http://testaccount.learnamp.com/en/users/7",
      "status": {
          "status": "Invite pending",
          "time": "Sent 25 Sep 19"
      }
  },
  "users": [
        {
          "id": 1,
          "firstName": "Test",
          "lastName": "User",
          "jobTitle": "Developer",
          "email": "test@email.com",
          "timeZone": "London",
          "language": "en",
          "role": "viewer",
          "profileUrl": "https://testaccount.learnamp.com/en/users/1",
          "status": {
              "status": "Confirmed",
              "time": "On 29 Nov 16"
          },
          "avatar": "AVATAR_IMAGE_URL",
          "manager": {
              "id": 17,
              "firstName": "Manager",
              "lastName": "User",
              "jobTitle": "Head of Ops",
              "email": "testuser2@email.com",
              "timeZone": "New York",
              "language": "en-US",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                  "status": "Confirmed",
                  "time": "On 20 Feb 17"
              }
          },
          "location": "London, UK",
          "primaryTeam": {
            "id": 15,
            "name": "Operations",
            "teamUsersCount": 10,
            "apiTeamPath": "/v1/teams/15.json",
            "apiTeamUsersPath": "/v1/teams/15/users.json",
            "manager": {
              "id": 17,
              "firstName": "Manager",
              "lastName": "User",
              "jobTitle": "Head of Ops",
              "email": "testuser2@email.com",
              "timeZone": "New York",
              "language": "en-US",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                "status": "Confirmed",
                "time": "On 20 Feb 17"
              }
            }
          },
          "secondaryTeams": []
        },
      ]
    }
  ]
}


> 400 Bad request - validation errors:

```json
{
    "error": "userId is missing, userId is empty",
    "fullErrors": {
        "userId": [
            "is missing",
            "is empty"
        ]
    }
}

Add a User to a Team - second version

curl --location --request POST 'https://api.learnamp.com/v1/teams/users' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'teamName=Marketing'
--form 'userEmail=new@member.com'
module Learnamp
  class TeamUsers
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def create(params)
      response = self.class.post('/teams/users', { body: params, headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

params = {
  userEmail: 'user@email.com',
  teamName: 'Tech Team'
}

Learnamp::TeamUsers.new(token).create(params)

Adds a user to a Team.

In order to simplify integration with third party services, another endpoint responsible for team member creation was implemented.

POST https://api.learnamp.com/v1/teams/users

Data in Body

Parameter Example value Description (* required)
teamId 1200 ID of the team
teamName "Marketing" Name of the team
userId 1 User ID of user to add to team
userEmail "user@email.com" Email of the new team member

Parameters teamId and teamName are mutually exclusive - only one of them can be present in the request payload. Same rule applies for userId and userEmail.

201 Created - successful response:

```json
{

  "id": 1,
  "name": "Test Team",
  "teamUsersCount": 2,
  "apiTeamPath": "/v1/teams/1.json",
  "apiTeamUsersPath": "/v1/teams/1/users.json",
  "manager": {
      "id": 7,
      "firstName": "Test",
      "lastName": "Manager",
      "jobTitle": "Ops Director",
      "email": "admin@example.com",
      "timeZone": "London",
      "language": "en",
      "role": "admin",
      "profileUrl": "http://testaccount.learnamp.com/en/users/7",
      "status": {
          "status": "Invite pending",
          "time": "Sent 25 Sep 19"
      }
  },
  "users": [
        {
          "id": 1,
          "firstName": "Test",
          "lastName": "User",
          "jobTitle": "Developer",
          "email": "test@email.com",
          "timeZone": "London",
          "language": "en",
          "role": "viewer",
          "profileUrl": "https://testaccount.learnamp.com/en/users/1",
          "status": {
              "status": "Confirmed",
              "time": "On 29 Nov 16"
          },
          "avatar": "AVATAR_IMAGE_URL",
          "manager": {
              "id": 17,
              "firstName": "Manager",
              "lastName": "User",
              "jobTitle": "Head of Ops",
              "email": "testuser2@email.com",
              "timeZone": "New York",
              "language": "en-US",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                  "status": "Confirmed",
                  "time": "On 20 Feb 17"
              }
          },
          "location": "London, UK",
          "primaryTeam": {
            "id": 15,
            "name": "Operations",
            "teamUsersCount": 10,
            "apiTeamPath": "/v1/teams/15.json",
            "apiTeamUsersPath": "/v1/teams/15/users.json",
            "manager": {
              "id": 17,
              "firstName": "Manager",
              "lastName": "User",
              "jobTitle": "Head of Ops",
              "email": "testuser2@email.com",
              "timeZone": "New York",
              "language": "en-US",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                "status": "Confirmed",
                "time": "On 20 Feb 17"
              }
            }
          },
          "secondaryTeams": []
        },
      ]
    }
  ]
}


> 400 Bad request - validation errors:

```json
{
    "error": "userId is missing, userId is empty",
    "fullErrors": {
        "userId": [
            "is missing",
            "is empty"
        ]
    }
}

Remove a User from a Team

Remove a user from team:

curl --location --request DELETE 'https://api.learnamp.com/v1/teams/1/users/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class TeamUsers
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def delete(team_id, user_id)
      response = self.class.delete("/teams/#{team_id}/users/#{user_id}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

Learnamp::TeamUsers.new(token).delete(245, 1)

Delete a user from a team. (User and team are kept, but their association is removed).

DELETE https://api.learnamp.com/v1/teams/{teamId}/users/{userId}

204 No Content - successful response:


404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Items

An item in Learn Amp is a learning object. It could be a SCORM, xAPI or AICC package. It could be a URL link to an external web page. It could be an embedded video, or downloadable file.

Items are typically organised into Channels and Learnlists.

View all Items

View all items in your account:

curl --location --request GET 'https://api.learnamp.com/v1/items' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Items
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def all
      response = self.class.get("/items", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

items = Learnamp::Items.new(token).all

View all items

GET https://api.learnamp.com/v1/items

Response will be paginated see pagination

200 OK - successful response:

{
    "items": [
        {
            "id": 3015,
            "title": "Activity 10",
            "shortDescription": null,
            "itemType": "Video",
            "itemCategory": "Audio/Visual",
            "itemUrl": "https://examplecompany.learnamp.com/en/items/activity-10"
        },
        {
            "id": 3014,
            "title": "rust-lang/rust",
            "shortDescription": null,
            "itemType": "Other",
            "itemCategory": "Other",
            "itemUrl": "https://examplecompany.learnamp.com/en/items/rust-lang-rust"
        }
    ]
}

Show an Item

Display details for a single Item:

curl --location --request GET 'https://api.learnamp.com/v1/items/3015' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Items
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def find(id)
      response = self.class.get("/items/#{id}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

item = Learnamp::Items.new(token).find(3015)

Display all details for one specific Item.

GET https://api.learnamp.com/v1/items/{itemId}

200 OK - successful response:

{
    "id": 3015,
    "title": "Marketing 101",
    "shortDescription": null,
    "itemType": "Video",
    "itemCategory": "Audio/Visual",
    "itemUrl": "https://examplecompany.learnamp.com/en/items/marketing-101",
    "url": "https://www.youtube.com/watch?v=8Sj2tbh-ozE",
    "description": "<p>Testing Youtube video</p>",
    "slug": "marketing-101",
    "fileSize": null,
    "fileType": null,
    "expires": false,
    "ratingsCount": 0,
    "averageRating": 0.0,
    "goesLive": false,
    "sourceType": null,
    "sourceId": null,
    "createdAt": "2021-03-02T11:09:35Z",
    "updatedAt": "2021-03-02T12:24:02Z",
    "goesLiveAt": null,
    "image": "http://res.cloudinary.com/dfiav5ctj/image/upload/c_crop,g_custom/a_exif,c_fill,dpr_1.0,f_auto,h_153,q_auto,w_260/v1614683346/c6q5ylwoencf2iaoc4zs.jpg",
    "supplier": {
        "id": 138,
        "name": "Youtube.com",
        "logo": "https://examplecompany.learnamp.com/assets/placeholders/organisation_avatar-cd6e9138f99068ded8cca1210674ac7abd1329738317547968943addc6056ae7.png"
    },
    "addedBy": {
        "id": 1,
        "firstName": "Test",
        "lastName": "User",
        "jobTitle": "Tester",
        "email": "test@example.com",
        "timeZone": "London",
        "language": "en",
        "role": "admin",
        "hireDate": "2017-02-01",
        "profileUrl": "https://examplecompany.learnamp.com/en/users/1",
        "status": {
            "status": "Confirmed",
            "time": "On 29 Nov 16"
        }
    },
    "displayAddedBy": false,
    "visibility": "Entire Company",
    "price": "Free",
    "totalTime": "< 10 mins",
    "tags": ["marketing", "video"]
}

404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Create an Item

Create a new Item:

curl --location --request POST 'https://api.learnamp.com/v1/items' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'url=https://www.test.com' \
--form 'description=This is the description'
--form 'title=This is Item title'
--form 'itemType=video'
--form 'totalTime=less_than_one_hour'
module Learnamp
  class Items
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def create(params)
      response = self.class.post("/items", { body: params, headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

params = {
  title: "Sales",
  url: "https://www.test.com"
  des1cription: "This is the description"
  tit1le: "This is Item title"
  ite1mType: "video"
  tot1alTime: "less_than_one_hour"
}

item = Learnamp::Items.new(token).create(params)

Create an Item

POST https://api.learnamp.com/v1/items

Data in Body

Parameter (* required) Example value Description
title * Sales and Marketing Guide Title of item
url https://www.test.com URL to external web page for the item
description Some description text Description of the item
expires true If item must expire, set to true
expiresAt 2022-12-31 Expiry date when item should expire in ISO 8601 format
goesLive true If item should have a future go live date
goesLiveAt 2022-12-31 Future go live date in ISO 8601 format
imageUrl https://sometileimageurl URL of tile image for the item, must be publically accessible
imageUrl https://sometileimageurl URL of tile image for the item, must be publically accessible
visibility entire_company Item visibility. Must be one of "hidden", "selected", "entire_company"
sourceType Udemy Short string identifier of the source of the item, if is coming from an external LMS or other system
sourceId e814koip External identifier of item, if it if coming from an external LMS or other system
itemType article Item type, one of: "article", "document", "book", "q_and_a", "info_card", "video", "elearning", "infographic", "audio", "slides", "image", "project", "classroom", "coaching", "course", "event", "presentation", "meeting", "webinar", "action", "test", "qa", "announcement", "newsletter", "reminder", "website", "other"
totalTime less_than_one_hour Approximate time to complete. One of: "less_than_fifteen_minutes", "less_than_one_hour", "one_to_ten_hours", "ten_to_one_hundred_hours", "more_than_one_hundred_hours", "less_than_five_minutes", "five_to_ten_minutes", "ten_to_twenty_minutes", "twenty_to_thirty_minutes", "more_than_thirty_minutes", "less_than_ten_minutes", "ten_to_thirty_minutes", "thirty_minutes_to_one_hour", "one_to_two_hours", "more_than_two_hours", "two_to_four_hours", "four_to_six_hours", "more_than_six_hours", "less_than_two_hours", "four_to_eight_hours", "eight_to_twelve_hours", "more_than_twelve_hours", "more_than_one_hour", "custom_time"
itemCategory audiovisual Category. One of: "written", "audiovisual", "activity_category", "assessment", "update_category", "other_category"

201 Created - successful response:

{
    "id": 3016,
    "title": "new item with tags",
    "shortDescription": null,
    "itemType": "Other",
    "itemCategory": "Other",
    "itemUrl": "https://examplecompany.learnamp.com/en/items/new-item-with-tags",
    "url": null,
    "description": "Short desc",
    "slug": "new-item-with-tags",
    "fileSize": null,
    "fileType": null,
    "expires": false,
    "ratingsCount": 0,
    "averageRating": 0.0,
    "goesLive": false,
    "sourceType": null,
    "sourceId": null,
    "createdAt": "2021-03-26T17:29:25Z",
    "updatedAt": "2021-03-26T17:29:25Z",
    "goesLiveAt": null,
    "image": "http://res.cloudinary.com/dfiav5ctj/image/upload/c_crop,g_custom/a_exif,c_fill,dpr_1.0,f_auto,h_153,q_auto,w_260/v1588665654/e5pclrrfd8xyyffphich.jpg",
    "supplier": null,
    "addedBy": {
        "id": 1381,
        "firstName": "Rebecca",
        "lastName": "Bridger",
        "jobTitle": "Founder & Managing Director",
        "email": "rebecca@example.com",
        "timeZone": "London",
        "language": "en",
        "role": "owner",
        "hireDate": null,
        "profileUrl": "https://examplecompany.learnamp.com/en/users/1381",
        "status": {
            "status": "Not yet invited"
        }
    },
    "displayAddedBy": false,
    "visibility": "Entire Company",
    "price": "Free",
    "totalTime": "< 15 mins",
    "tags": []
}

400 Bad request - validation errors:

{
    "error": "title is missing",
    "fullErrors": {
        "title": [
            "is missing"
        ],
    }
}

Update an Item

Update an Item:

curl --location --request PUT 'https://api.learnamp.com/v1/items/383' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'title=New Item Title'
module Learnamp
  class Items
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def update(id, params)
      response = self.class.put("/items/#{id}", { body: params, headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

item = Learnamp::Items.new(token).update(1234, params)

Update an Item

POST https://api.learnamp.com/v1/items

Data in Body

Parameter (* required) Example value Description
title * Sales and Marketing Guide Title of item
url https://www.test.com URL to external web page for the item
description Some description text Description of the item
expires true If item must expire, set to true
expiresAt 2022-12-31 Expiry date when item should expire in ISO 8601 format
goesLive true If item should have a future go live date
goesLiveAt 2022-12-31 Future go live date in ISO 8601 format
imageUrl https://sometileimageurl URL of tile image for the item, must be publically accessible
imageUrl https://sometileimageurl URL of tile image for the item, must be publically accessible
visibility entire_company Item visibility. Must be one of "hidden", "selected", "entire_company"
sourceType Udemy Short string identifier of the source of the item, if is coming from an external LMS or other system
sourceId e814koip External identifier of item, if it if coming from an external LMS or other system
itemType article Item type, one of: "article", "document", "book", "q_and_a", "info_card", "video", "elearning", "infographic", "audio", "slides", "image", "project", "classroom", "coaching", "course", "event", "presentation", "meeting", "webinar", "action", "test", "qa", "announcement", "newsletter", "reminder", "website", "other"
totalTime less_than_one_hour Approximate time to complete. One of: "less_than_fifteen_minutes", "less_than_one_hour", "one_to_ten_hours", "ten_to_one_hundred_hours", "more_than_one_hundred_hours", "less_than_five_minutes", "five_to_ten_minutes", "ten_to_twenty_minutes", "twenty_to_thirty_minutes", "more_than_thirty_minutes", "less_than_ten_minutes", "ten_to_thirty_minutes", "thirty_minutes_to_one_hour", "one_to_two_hours", "more_than_two_hours", "two_to_four_hours", "four_to_six_hours", "more_than_six_hours", "less_than_two_hours", "four_to_eight_hours", "eight_to_twelve_hours", "more_than_twelve_hours", "more_than_one_hour", "custom_time"
itemCategory audiovisual Category. One of: "written", "audiovisual", "activity_category", "assessment", "update_category", "other_category"

200 OK - successful response:

{
    "id": 3016,
    "title": "new item with tags",
    "shortDescription": null,
    "itemType": "Other",
    "itemCategory": "Other",
    "itemUrl": "https://examplecompany.learnamp.com/en/items/new-item-with-tags",
    "url": null,
    "description": "Short desc",
    "slug": "new-item-with-tags",
    "fileSize": null,
    "fileType": null,
    "expires": false,
    "ratingsCount": 0,
    "averageRating": 0.0,
    "goesLive": false,
    "sourceType": null,
    "sourceId": null,
    "createdAt": "2021-03-26T17:29:25Z",
    "updatedAt": "2021-03-26T17:29:25Z",
    "goesLiveAt": null,
    "image": "http://res.cloudinary.com/dfiav5ctj/image/upload/c_crop,g_custom/a_exif,c_fill,dpr_1.0,f_auto,h_153,q_auto,w_260/v1588665654/e5pclrrfd8xyyffphich.jpg",
    "supplier": null,
    "addedBy": {
        "id": 1381,
        "firstName": "Rebecca",
        "lastName": "Bridger",
        "jobTitle": "Founder & Managing Director",
        "email": "rebecca@example.com",
        "timeZone": "London",
        "language": "en",
        "role": "owner",
        "hireDate": null,
        "profileUrl": "https://examplecompany.learnamp.com/en/users/1381",
        "status": {
            "status": "Not yet invited"
        }
    },
    "displayAddedBy": false,
    "visibility": "Entire Company",
    "price": "Free",
    "totalTime": "< 15 mins",
    "tags": []
}

400 Bad request - validation errors:

{
    "error": "title is missing",
    "fullErrors": {
        "title": [
            "is missing"
        ]
    }
}

Delete an Item

Delete an item:

curl --location --request DELETE 'https://api.learnamp.com/v1/items/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Items
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def delete(id)
      response = self.class.delete("/items/#{id}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

Learnamp::Items.new(token).delete(1)

Delete an Item

DELETE https://api.learnamp.com/v1/items/{itemId}

204 No Content - successful response:


404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Learnlists

Learnlist Description

In Learn Amp, a Learnlist is a 'playlist' of content. It can be structured, like a course with a specific sequence, or an unordered collection of learning items.

View All Learnlists

View all learnlists in your account:

curl --location --request GET 'https://api.learnamp.com/v1/learnlists' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Learnlists
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def all(filters)
      filters_query = URI.encode_www_form(filters)
      response = self.class.get("/learnlists?#{filters_query}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

filters = {
}
teams = Learnamp::Learnlists.new(token).all(filters)

View all learnlists

GET https://api.learnamp.com/v1/learnlists

Response will be paginated see pagination

200 OK - successful response:

{
    "learnlists": [
        {
            "id": 379,
            "title": "Test learnlist",
            "description": "This is the learnlist description"
        },
  ]
}

Users

User Description

In Learn Amp, a User, is a person who can access the platform. User's belong to your company account, and have a status like Invite Pending, Active or Deactivated.

View All Users

View all users in your account:

curl --location --request GET 'https://api.learnamp.com/v1/users' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Users
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def all
      response = self.class.get('/users', { headers: headers })
      response.parsed_response if response.ok?
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

users = Learnamp::Users.new(token).all

View all users.

GET https://api.learnamp.com/v1/users

Response will be paginated see pagination

Optional Filters in URL Params

The following URL params may be included, to filter the result set:

GET https://api.learnamp.com/v1/users?filters[email]=test@email.com

URL Param Example Value Description
expanded true Optional expanded json. Returns all available user details including custom fields and teams information.
filters[email] email@test.com Return users with matching email address
filters[first_name] John Return users with matching first name (using ILIKE '%value%')
filters[last_name] Smith Return users with matching last name (using ILIKE '%value%')
filters[role] viewer Return users with matching role.
Possible values: "viewer", "curator", "reporter", "hr", "admin", "owner"
filters[no_team] true Return users that have no team assigned
filters[team_ids] [1,2,3] or 1,2,3 Return members of any of the given teams by team ID.

Param can be array of team ids, or a string of comma seperated team ids
filters[created_at][from] "2021-12-31" Created date range FROM date in ISO 8601 format
filters[created_at][to] "2022-02-28" Created date range TO date in ISO 8601 format
filters[updated_at][from] "2021-12-31" Updated date range FROM date in ISO 8601 format
filters[updated_at][to] "2022-02-28" Updated date range TO date in ISO 8601 format
filters[deactivated_at][from] "2021-12-31" Deactivated date range FROM date in ISO 8601 format
filters[deactivated_at][to] "2022-02-28" Deactivated date range TO date in ISO 8601 format

200 OK - successful response:

{
  "users": [
    {
      "id": 1,
      "firstName": "Test",
      "lastName": "User",
      "jobTitle": "Developer",
      "email": "test@email.com",
      "timeZone": "London",
      "language": "en",
      "role": "viewer",
      "hireDate": "2021-01-15",
      "profileUrl": "https://testaccount.learnamp.com/en/users/1",
      "status": {
          "status": "Confirmed",
          "time": "On 29 Nov 16"
      },
    },
  ]
}

200 OK - successfully response, when param expanded=true is included

{
  "users": [
    {
        "id": 1,
        "firstName": "Test",
        "lastName": "User",
        "jobTitle": "Developer",
        "email": "test@email.com",
        "timeZone": "London",
        "language": "en",
        "role": "viewer",
        "hireDate": "2021-01-15",
        "profileUrl": "https://testaccount.learnamp.com/en/users/1",
        "status": {
            "status": "Confirmed",
            "time": "On 29 Nov 16"
        },
        "avatar": "https://res.cloudinary.com/dfiav5ctj/image/upload/c_crop,g_custom/a_exif,c_fill,dpr_1.0,f_auto,q_auto,w_100/v1505401603/iysnlkr6sr6ys0dybeh0.jpg",
        "manager": {
            "id": 17,
            "firstName": "Test",
            "lastName": "Manager",
            "jobTitle": "Ops Director",
            "email": "test2@email.com",
            "timeZone": "London",
            "language": "en",
            "role": "admin",
            "profileUrl": "https://testaccount.learnamp.com/en/users/17",
            "status": {
                "status": "Confirmed",
                "time": "On 20 Feb 17"
            }
        },
        "location": "London, UK",
        "department": "Marketing",
        "primaryTeam": {
            "id": 15,
            "name": "Operations",
            "teamUsersCount": 1,
            "apiTeamPath": "/v1/teams/15.json",
            "apiTeamUsersPath": "/v1/teams/15/users.json",
            "manager": {
              "id": 17,
              "firstName": "Test",
              "lastName": "Manager",
              "jobTitle": "Ops Director",
              "email": "test2@email.com",
              "timeZone": "London",
              "language": "en",
              "role": "admin",
              "profileUrl": "https://testaccount.learnamp.com/en/users/17",
              "status": {
                  "status": "Confirmed",
                  "time": "On 20 Feb 17"
              }
            }
          },
        "secondaryTeams": []
      }
  ]
}

Show a User

Display details for a single user:

curl --location --request GET 'https://api.learnamp.com/v1/users/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Users
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def find(id)
      response = self.class.get("/users/#{id}", { headers: headers })
      response.parsed_response if response.ok?
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

user = Learnamp::Users.new(token).find(1920)

Display user details for one specific user.

GET https://api.learnamp.com/v1/users/{userId}

200 OK - successful response:

{
    "id": 1,
    "firstName": "Test",
    "lastName": "User",
    "jobTitle": "Developer",
    "email": "test@email.com",
    "timeZone": "London",
    "language": "en",
    "role": "viewer",
    "hireDate": "2021-01-15",
    "profileUrl": "https://testaccount.learnamp.com/en/users/1",
    "status": {
        "status": "Confirmed",
        "time": "On 29 Nov 16"
    },
    "avatar": "https://res.cloudinary.com/dfiav5ctj/image/upload/c_crop,g_custom/a_exif,c_fill,dpr_1.0,f_auto,q_auto,w_100/v1505401603/iysnlkr6sr6ys0dybeh0.jpg",
    "manager": {
        "id": 17,
        "firstName": "Test",
        "lastName": "Manager",
        "jobTitle": "Ops Director",
        "email": "test2@email.com",
        "timeZone": "London",
        "language": "en",
        "role": "admin",
        "profileUrl": "https://testaccount.learnamp.com/en/users/17",
        "status": {
            "status": "Confirmed",
            "time": "On 20 Feb 17"
        }
    },
    "location": "London, UK",
    "department": "Marketing",
    "primaryTeam": {
        "id": 15,
        "name": "Operations",
        "teamUsersCount": 1,
        "apiTeamPath": "/v1/teams/15.json",
        "apiTeamUsersPath": "/v1/teams/15/users.json",
        "manager": {
          "id": 17,
          "firstName": "Test",
          "lastName": "Manager",
          "jobTitle": "Ops Director",
          "email": "test2@email.com",
          "timeZone": "London",
          "language": "en",
          "role": "admin",
          "profileUrl": "https://testaccount.learnamp.com/en/users/17",
          "status": {
              "status": "Confirmed",
              "time": "On 20 Feb 17"
          }
        }
      }
    },
    "secondaryTeams": []
}

404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Create a User

Create a new user in your account:

curl --location --request POST 'https://api.learnamp.com/v1/users' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN' \
--form 'email=testuser@test.com' \
--form 'firstName=Test' \
--form 'lastName=User' \
--form 'role=curator' \
--form 'language=fr' \
--form 'jobTitle=Developer' \
--form 'primaryTeamId=15' \
--form 'secondaryTeamIds[]=376' \
--form 'managerId=1' \
--form 'skipInvitation=true' \
--form 'secondaryTeamIds[]=377'
module Learnamp
  class Users
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def create(params)
      response = self.class.post("/users", { body: params, headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

params = {
  email:  "testuser@test.com",
  firstName: "Test",
  lastName:  "User",
  language: "en",
  jobTitle:  "Developer",
  role: "viewer",
  primaryTeamId: 379,
  secondaryTeamIds:  [376,377],
  managerId: 1,
  skipInvitation:  true,
  hireDate:  "2021-02-28",
  location:  "London",
  department:  "Marketing",
  customFields: [{ name: "Employee ID", value: "123456" }]
}

user = Learnamp::Users.new(token).create(params)

Create a user and trigger an invite email.

POST https://api.learnamp.com/v1/users

Data in Body

Parameter Example value Description (* required)
email testuser@test.com Email address of user (*)
firstName Test First name of user (*)
lastName User Last name of user (*)
language fr Primary language short code. One of: en, en-US, de, es-CO, fr, it, nl, pt-BR, pl, ru, zh-CN, zh-TW, ja, ar
jobTitle Developer Job title of user
role viewer user's role. One of: viewer, curator, admin, hr, reporter
primaryTeamId 15 Team ID of primary team see Teams
secondaryTeamIds [376,377] Array of Team IDs of seconary teams
managerId 1 User ID of this user's Manager (override manager, not primary team manager)
skipInvitation true Skip sending the user an invitation email immediately. If skipInvitation is not set, the user will be immediately sent an invitation email
hireDate 2021-02-28 Employment start date for user in ISO 8601 date format
location London Primary location of user
department Marketing Department of user
customFields [{ name: "Employee ID", value: "12-34-56" }] CustomFields param is an array, of name/value pairs for custom fields.

201 Created - successful response:

{
    "id": 1,
    "firstName": "Test",
    "lastName": "User",
    "jobTitle": "Developer",
    "email": "test@email.com",
    "timeZone": "London",
    "language": "en",
    "role": "viewer",
    "hireDate": "2021-01-15",
    "profileUrl": "https://testaccount.learnamp.com/en/users/1",
    "status": {
        "status": "Confirmed",
        "time": "On 29 Nov 16"
    },
    "avatar": "https://res.cloudinary.com/dfiav5ctj/image/upload/c_crop,g_custom/a_exif,c_fill,dpr_1.0,f_auto,q_auto,w_100/v1505401603/iysnlkr6sr6ys0dybeh0.jpg",
    "manager": {
        "id": 17,
        "firstName": "Test",
        "lastName": "Manager",
        "jobTitle": "Ops Director",
        "email": "test2@email.com",
        "timeZone": "London",
        "language": "en",
        "role": "admin",
        "profileUrl": "https://testaccount.learnamp.com/en/users/17",
        "status": {
            "status": "Confirmed",
            "time": "On 20 Feb 17"
        }
    },
    "location": "London, UK",
    "department": "Marketing",
    "primaryTeam": {
        "id": 15,
        "name": "Operations",
        "teamUsersCount": 1,
        "apiTeamPath": "/v1/teams/15.json",
        "apiTeamUsersPath": "/v1/teams/15/users.json",
        "manager": {
          "id": 17,
          "firstName": "Test",
          "lastName": "Manager",
          "jobTitle": "Ops Director",
          "email": "test2@email.com",
          "timeZone": "London",
          "language": "en",
          "role": "admin",
          "profileUrl": "https://testaccount.learnamp.com/en/users/17",
          "status": {
              "status": "Confirmed",
              "time": "On 20 Feb 17"
          }
        }
      }
    },
    "secondaryTeams": []
}

400 Bad request - validation errors:

{
    "error": "email is missing, email is empty, firstName is missing, lastName is missing",
    "fullErrors": {
        "email": [
            "is missing",
            "is empty"
        ],
        "firstName": [
            "is missing"
        ],
        "lastName": [
            "is missing"
        ]
    }
}

Update a user

Update an existing user:

curl --location --request PUT 'https://api.learnamp.com/v1/users/1382' \
--header 'Authorization: Bearer SQn9nZAxgwPJcz-neajmNahBdlc2DRoNbUHwx9A4Rvw' \
--form 'firstName=Jim' \
--form 'lastName=Robinson' \
--form 'jobTitle=Businessman' \
--form 'language=en' \
--form 'primaryTeamId=379' \
--form 'managerId=1' \
--form 'email=jimrobinson@test.com' \
--form 'secondaryTeamIds[]=380'
module Learnamp
  class Users
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def update(id, params)
      response = self.class.put("/users/#{id}", { body: params, headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

params = {
  email:  "testuser@test.com",
  firstName: "Test2",
  lastName:  "User2",
  language: "en",
  jobTitle:  "Developer",
  role: "viewer",
  primaryTeamId: 379,
  secondaryTeamIds:  [376,377],
  managerId: 1,
  skipInvitation:  true,
  hireDate:  "2021-02-28",
  location:  "London",
  department:  "Marketing",
  customFields: [{ name: "Employee ID", value: "123456" }]
}

user = Learnamp::Users.new(token).update(1904, params)

Update a user's details'.

PUT https://api.learnamp.com/v1/users/{userId}

Data in Body

Parameter type Example value Description (* required)
email email testuser@test.com Email address of user (*)
firstName string Test First name of user (*)
lastName string User Last name of user (*)
language enum fr Primary language short code. One of: en, en-US, de, es-CO, fr, it, nl, pt-BR, pl, ru, zh-CN, zh-TW, ja, ar
jobTitle string Developer Job title of user
primaryTeamId integer 15 Team ID of primary team see Teams
secondaryTeamIds Array(integer) [376,377] Array of Team IDs of seconary teams
managerId integer 1 User ID of this user's Manager (override manager, not primary team manager)
hireDate date 2021-02-28 Employment start date for user in ISO 8601 date format
location string London Primary location of user
department string Marketing Department of user
reactivate boolean true Reactivates user if deactivated
customFields object [{ name: "Employee ID", value: "12-34-56" }] CustomFields param is an array, of name/value pairs for custom fields.

200 OK - successful response:

{
    "id": 1382,
    "firstName": "Jim",
    "lastName": "Robinson",
    "jobTitle": "Businessman",
    "email": "jimrobinson@test.com",
    "timeZone": "London",
    "language": "en",
    "role": "admin",
    "profileUrl": "https://testaccount.learnamp.com/en/users/1382",
    "status": {
        "status": "Invite pending",
        "time": "Sent 25 Sep 19"
    },
    "avatar": "AVATAR_URL",
    "manager": {
        "id": 1,
        "firstName": "Test",
        "lastName": "User",
        "jobTitle": "Director",
        "email": "test@email.com",
        "timeZone": "London",
        "language": "en",
        "role": "admin",
        "profileUrl": "https://testaccount.learnamp.com/en/users/1",
        "status": {
            "status": "Confirmed",
            "time": "On 29 Nov 16"
        }
    },
    "location": null,
    "primaryTeam": {
        "id": 379,
        "name": "Team 1",
        "teamUsersCount": 3,
        "apiTeamPath": "/v1/teams/379.json",
        "apiTeamUsersPath": "/v1/teams/379/users.json",
        "manager": {
        }
    },
    "secondaryTeams": [
        {
            "id": 380,
            "name": "Team 2 - operations",
            "teamUsersCount": 1,
            "apiTeamPath": "/v1/teams/380.json",
            "apiTeamUsersPath": "/v1/teams/380/users.json",
            "manager": {
            }
        }
    ]
}

400 Bad request - validation errors:

{
    "error": "email is missing, email is empty, firstName is missing, lastName is missing",
    "fullErrors": {
        "email": [
            "is missing",
            "is empty"
        ],
        "firstName": [
            "is missing"
        ],
        "lastName": [
            "is missing"
        ]
    }
}

Deactivate a User

Deactivate a user:

curl --location --request PUT 'https://api.learnamp.com/v1/users/1/deactivate' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Users
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def deactivate(id)
      response = self.class.put("/users/#{id}/deactivate", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

Learnamp::Users.new(token).deactivate(1904)

Deactivate a user, so that they can no longer login. Their data is not removed.

PUT https://api.learnamp.com/v1/users/{userId}/deactivate

204 No Content - successful response:


404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Reactivate a User

Reactivate a deactivated user:

curl --location --request PUT 'https://api.learnamp.com/v1/users/1/reactivate' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Users
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def reactivate(id)
      response = self.class.put("/users/#{id}/reactivate", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

Learnamp::Users.new(token).reactivate(1904)

Reactivate a user, so that they login again.

PUT https://api.learnamp.com/v1/users/{userId}/reactivate

204 No Content - successful response:


404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Delete a User

Delete a user:

curl --location --request DELETE 'https://api.learnamp.com/v1/users/1' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Users
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def delete(id)
      response = self.class.delete("/users/#{id}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

Learnamp::Users.new(token).delete(1904)

Delete a user, so that they can no longer login. Their data is removed.

DELETE https://api.learnamp.com/v1/users/{userId}

204 No Content - successful response:


404 Not Found - unsuccessful response:

{
    "error": "Not found"
}

Channels Progress

View progress of all assigned channels by the specified user:

curl --location --request GET 'https://api.learnamp.com/v1/users/567/channels_progress' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Users
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def channels_progress(user_id)
      response = self.class.get("/channels/#{user_id}/users_progress", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

data = Learnamp::Users.new(token).Channels_progress(123)

View progress of all assigned channels by a specified user. This is analogous to Learn Amp's People Log feature, for a single user.

GET https://api.learnamp.com/v1/users/{userId}/channels_progress

This end-point will return a paginated array of channels that are assigned to the specified user. Each element will contain the completion percentage of the channel by that user, as well as the datetime (if any) when the channel was completed.

Please note: The completion percentage is a cached value, which is refreshed in the background automatically. The completion percentage shown may therefore take a few minutes to update.

The results are ordered alphabetically by created at date of the channel, most recent first.

The end-point will accept a userId of a deactivated user, and return the deactivated users's channel progress.

Response will be paginated see pagination

200 OK - successful response:

[
    {
        "user_id": 200321,
        "first_name": "John",
        "last_name": "Abc",
        "email": "jabc@test.com",
        "content_name": "Favourites",
        "content_type": "Channel",
        "content_id": 1,
        "completed": false,
        "completion_percent": 50,
        "completed_at": null
    },
    {
        "user_id": 200321,
        "first_name": "John",
        "last_name": "Abc",
        "email": "jabc@test.com",
        "content_name": "Compliance Training",
        "content_type": "Channel",
        "content_id": 2,
        "completed": true,
        "completion_percent": 100,
        "completed_at": "2023-04-04T15:44:04Z"
    },
    {
        "user_id": 200321,
        "first_name": "John",
        "last_name": "Abc",
        "email": "jabc@test.com",
        "content_name": "Business Essentials",
        "content_type": "Channel",
        "content_id": 3,
        "completed": false,
        "completion_percent": 0,
        "completed_at": null
    }
]

404 Not Found - unsuccessful response when user ID does not exist:

{
    "error": "Not found"
}

Verbs

Verb Description

In Learn Amp, each Activity has an associated Verb. Verbs are a concept in the TinCan/xAPI specification. To simplify integration with xAPI, our verbs are taken from the Tin Can Registry.

View All Verbs

View all available verbs:

curl --location --request GET 'https://api.learnamp.com/v1/verbs' \
--header 'Authorization: Bearer YOUR-ACCESS-TOKEN'
module Learnamp
  class Verbs
    include HTTParty
    base_uri "#{ENV['BASE_URL']}#{ENV['API_PATH']}"

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def all(filters)
      response = self.class.get("/verbs}", { headers: headers })
      response.parsed_response
    end

    private

    def headers
      {
        'Authorization' => "Bearer #{token}"
      }
    end
  end
end

verbs = Learnamp::Verbs.new(token).all

View all verbs

GET https://api.learnamp.com/v1/verbs

Response will be paginated see pagination

200 OK - successful response:

{
    "verbs": [
        {
            "id": 1,
            "name": "accepted",
            "tinCanId": "http://activitystrea.ms/schema/1.0/accept"
        },
        {
            "id": 4,
            "name": "added",
            "tinCanId": "http://activitystrea.ms/schema/1.0/add"
        },
        {
            "id": 100,
            "name": "arranged",
            "tinCanId": "http://id.tincanapi.com/verb/arranged"
        },
        {
            "id": 12,
            "name": "attended",
            "tinCanId": "http://activitystrea.ms/schema/1.0/attend"
        },
        {
            "id": 139,
            "name": "clicked",
            "tinCanId": "http://adlnet.gov/expapi/verbs/interacted"
        },
        {
            "id": 73,
            "name": "completed",
            "tinCanId": "http://adlnet.gov/expapi/verbs/completed"
        },
        {
            "id": 108,
            "name": "downloaded",
            "tinCanId": "http://id.tincanapi.com/verb/downloaded"
        },
        {
            "id": 140,
            "name": "enrolled",
            "tinCanId": "http://adlnet.gov/expapi/verbs/registered"
        },
        {
            "id": 76,
            "name": "failed",
            "tinCanId": "http://adlnet.gov/expapi/verbs/failed"
        },
        {
            "id": 38,
            "name": "listened to",
            "tinCanId": "http://activitystrea.ms/schema/1.0/listen"
        },
        {
            "id": 135,
            "name": "logged in",
            "tinCanId": "https://brindlewaye.com/xAPITerms/verbs/loggedin/"
        },
        {
            "id": 136,
            "name": "logged out",
            "tinCanId": "https://brindlewaye.com/xAPITerms/verbs/loggedout/"
        },
        {
            "id": 44,
            "name": "read",
            "tinCanId": "http://activitystrea.ms/schema/1.0/read"
        },
        {
            "id": 141,
            "name": "received cerificate for",
            "tinCanId": "http://activitystrea.ms/schema/1.0/receive"
        },
        {
            "id": 56,
            "name": "started",
            "tinCanId": "http://activitystrea.ms/schema/1.0/start"
        },
        {
            "id": 65,
            "name": "updated",
            "tinCanId": "http://activitystrea.ms/schema/1.0/update"
        },
        {
            "id": 133,
            "name": "viewed",
            "tinCanId": "http://id.tincanapi.com/verb/viewed"
        },
        {
            "id": 67,
            "name": "watched",
            "tinCanId": "http://activitystrea.ms/schema/1.0/watch"
        }
    ]
}

Paginated Responses

All "View All" type responses will be paginated.

Pagination data in Reponse

Pagination data will be available in the following response headers:

Response Header Example value Description
Total 1032 Total number of matching results
Per-Page 10 Number of results per page
Total-Pages 103 Total number of pages

Apply pagination in Request

Pagination data can be set, by adding the following URL params in the request:

Request URL param Example value Description
page 2 Return the second page of results
perPage 20 Return 20 results per page

Example:

GET https://api.learnamp.com/v1/tasks?page=3&perPage=30

Errors

The Learn Amp API uses the following error codes:

Error Code Meaning Description
400 Bad Request Your request is invalid.
401 Unauthorized Your API key is wrong.
403 Forbidden You do not have sufficient permissions to access the resource.
404 Not Found The specified resource could not be found.
406 Not Acceptable You requested a format that isn't json.
410 Gone The resources has been removed from our servers.
429 Too Many Requests You're requesting too many API calls.
500 Internal Server Error We had a problem with our server. Try again later.
503 Service Unavailable We're temporarily offline for maintenance. Please try again later.

Time Zones

The Activities API supports an optional TimeZone parameter.

The table below lists the mapping between the name used as input, and the TZ Identifier

Time Zone Mappings

Location Time Zone
International Date Line West Etc/GMT+12
Midway Island Pacific/Midway
American Samoa Pacific/Pago_Pago
Hawaii Pacific/Honolulu
Alaska America/Juneau
Pacific Time (US & Canada) America/Los_Angeles
Tijuana America/Tijuana
Mountain Time (US & Canada) America/Denver
Arizona America/Phoenix
Chihuahua America/Chihuahua
Mazatlan America/Mazatlan
Central Time (US & Canada) America/Chicago
Saskatchewan America/Regina
Guadalajara America/Mexico_City
Mexico City America/Mexico_City
Monterrey America/Monterrey
Central America America/Guatemala
Eastern Time (US & Canada) America/New_York
Indiana (East) America/Indiana/Indianapolis
Bogota America/Bogota
Lima America/Lima
Quito America/Lima
Atlantic Time (Canada) America/Halifax
Caracas America/Caracas
La Paz America/La_Paz
Santiago America/Santiago
Newfoundland America/St_Johns
Brasilia America/Sao_Paulo
Buenos Aires America/Argentina/Buenos_Aires
Montevideo America/Montevideo
Georgetown America/Guyana
Puerto Rico America/Puerto_Rico
Greenland America/Godthab
Mid-Atlantic Atlantic/South_Georgia
Azores Atlantic/Azores
Cape Verde Is. Atlantic/Cape_Verde
Dublin Europe/Dublin
Edinburgh Europe/London
Lisbon Europe/Lisbon
London Europe/London
Casablanca Africa/Casablanca
Monrovia Africa/Monrovia
UTC Etc/UTC
Belgrade Europe/Belgrade
Bratislava Europe/Bratislava
Budapest Europe/Budapest
Ljubljana Europe/Ljubljana
Prague Europe/Prague
Sarajevo Europe/Sarajevo
Skopje Europe/Skopje
Warsaw Europe/Warsaw
Zagreb Europe/Zagreb
Brussels Europe/Brussels
Copenhagen Europe/Copenhagen
Madrid Europe/Madrid
Paris Europe/Paris
Amsterdam Europe/Amsterdam
Berlin Europe/Berlin
Bern Europe/Zurich
Zurich Europe/Zurich
Rome Europe/Rome
Stockholm Europe/Stockholm
Vienna Europe/Vienna
West Central Africa Africa/Algiers
Bucharest Europe/Bucharest
Cairo Africa/Cairo
Helsinki Europe/Helsinki
Kyiv Europe/Kiev
Riga Europe/Riga
Sofia Europe/Sofia
Tallinn Europe/Tallinn
Vilnius Europe/Vilnius
Athens Europe/Athens
Istanbul Europe/Istanbul
Minsk Europe/Minsk
Jerusalem Asia/Jerusalem
Harare Africa/Harare
Pretoria Africa/Johannesburg
Kaliningrad Europe/Kaliningrad
Moscow Europe/Moscow
St. Petersburg Europe/Moscow
Volgograd Europe/Volgograd
Samara Europe/Samara
Kuwait Asia/Kuwait
Riyadh Asia/Riyadh
Nairobi Africa/Nairobi
Baghdad Asia/Baghdad
Tehran Asia/Tehran
Abu Dhabi Asia/Muscat
Muscat Asia/Muscat
Baku Asia/Baku
Tbilisi Asia/Tbilisi
Yerevan Asia/Yerevan
Kabul Asia/Kabul
Ekaterinburg Asia/Yekaterinburg
Islamabad Asia/Karachi
Karachi Asia/Karachi
Tashkent Asia/Tashkent
Chennai Asia/Kolkata
Kolkata Asia/Kolkata
Mumbai Asia/Kolkata
New Delhi Asia/Kolkata
Kathmandu Asia/Kathmandu
Astana Asia/Dhaka
Dhaka Asia/Dhaka
Sri Jayawardenepura Asia/Colombo
Almaty Asia/Almaty
Novosibirsk Asia/Novosibirsk
Rangoon Asia/Rangoon
Bangkok Asia/Bangkok
Hanoi Asia/Bangkok
Jakarta Asia/Jakarta
Krasnoyarsk Asia/Krasnoyarsk
Beijing Asia/Shanghai
Chongqing Asia/Chongqing
Hong Kong Asia/Hong_Kong
Urumqi Asia/Urumqi
Kuala Lumpur Asia/Kuala_Lumpur
Singapore Asia/Singapore
Taipei Asia/Taipei
Perth Australia/Perth
Irkutsk Asia/Irkutsk
Ulaanbaatar Asia/Ulaanbaatar
Seoul Asia/Seoul
Osaka Asia/Tokyo
Sapporo Asia/Tokyo
Tokyo Asia/Tokyo
Yakutsk Asia/Yakutsk
Darwin Australia/Darwin
Adelaide Australia/Adelaide
Canberra Australia/Canberra
Melbourne Australia/Melbourne