Back

LearnWorlds API Essential Guide

Aug 14, 20246 minute read

What type of API does LearnWorlds provide?

Based on the search results provided, LearnWorlds appears to have a REST API. The documentation does not mention GraphQL or SOAP APIs.

API Type

LearnWorlds uses a REST API.

Authentication

  • LearnWorlds uses OAuth2 for API authentication.
  • You need to request API credentials from your LearnWorlds School settings.
  • The API expects an Access Token to be included in all requests.

API Documentation

  • LearnWorlds provides detailed API documentation, including examples.
  • The documentation can be found at a link provided in their support article.
  • It's important to use the latest version of the LearnWorlds API, as version 1 is no longer supported.

API Functionality

The LearnWorlds API allows you to:

  • Get information on various entities like courses, user info, bundles, subscriptions, promotions, payments, certifications, and more.
  • Implement Single Sign-On (SSO) functionality.

Best Practices

  • Keep your access token secret.
  • Use a proxy for API requests to avoid exposing your client secret.
  • Ensure you're using the latest version of the API.
  • Use the provided API URL when making calls on the backend.

In summary, LearnWorlds offers a REST API with OAuth2 authentication, providing access to various functionalities of their platform. It's important to follow their documentation and best practices when implementing and using the API.

Does the LearnWorlds API have webhooks?

Availability of Webhooks

Yes, the official LearnWorlds API does have webhooks. Webhooks are available as part of LearnWorlds' API and integration capabilities.

Types of Events You Can Subscribe To

LearnWorlds offers a variety of webhook events that you can subscribe to. Some of the available webhook events include:

  • When a user is registered/updated
  • When products are bought
  • When a free course enrollment occurs
  • When an email lead is captured
  • When a certificate is awarded
  • When a course is completed
  • When a subscription/installment is paid
  • When a subscription/installment is canceled
  • When a subscription trial is started
  • When a subscription trial ends in three days
  • When a free section is previewed
  • When a subscription is updated
  • When a user unenrolls from product
  • When tags are added to a user
  • When tags are removed from a user
  • When a payment is created

Key Points to Consider

  1. Webhook Signatures: LearnWorlds includes a pre-shared Learnworlds-Webhook-Signature header with each incoming webhook, allowing you to verify their integrity.

  2. Retry Mechanism: If a webhook does not receive a successful response, LearnWorlds retries 20 times, doubling the time between retries (1 minute, 2 minutes, 4 minutes, etc.).

  3. Real-time Data Transfer: Webhooks provide real-time data transfer for key events, automatically sending specific JSON payloads to a selected URL.

  4. Enhanced Flexibility: Recent enhancements allow for initiating new webhook events through User Automations, adding multiple conditions, and including additional key-value data pairs in the payload.

  5. Integration Capabilities: Webhooks can be used to connect LearnWorlds with other enterprise software and automate workflows.

Setting Up Webhooks

To set up webhooks in LearnWorlds:

  1. Go to your LearnWorlds school settings.
  2. Navigate to Developers → Webhooks.
  3. Activate the desired event by ticking the checkbox.
  4. Paste the webhook URL in the URL address field.
  5. Save the changes and send dummy data to test the webhook.

In conclusion, LearnWorlds offers a robust webhook system as part of its API, allowing you to subscribe to various events and integrate your LearnWorlds school with other systems and applications.

Rate Limits and other limitations

Based on the search results provided, here is the information about API rate limits for the LearnWorlds API:

API Rate Limits

Unfortunately, the search results do not contain any specific information about API rate limits for the LearnWorlds API. The documentation provided focuses on other aspects of the API such as authentication, endpoints, and webhooks, but does not mention rate limiting.

Key Points to Consider

  1. While rate limits are not explicitly stated, it's common for APIs to have some form of rate limiting to prevent abuse and ensure fair usage.

  2. LearnWorlds uses OAuth 2.0 for API authentication, which suggests a modern API infrastructure that likely includes rate limiting mechanisms.

  3. The API documentation is available and should be consulted for the most up-to-date and accurate information on any potential rate limits.

Best Practices

  1. Check the official LearnWorlds API documentation for any updates or information on rate limits that may not be reflected in these search results.

  2. Contact LearnWorlds support directly if you need specific information about rate limits for your use case.

  3. When implementing API calls, it's generally good practice to include error handling that can deal with potential rate limit responses, even if limits are not explicitly stated.

  4. Consider implementing your own throttling mechanism to ensure your application doesn't overwhelm the API with too many requests in a short period.

In conclusion, while the search results do not provide specific information about API rate limits for LearnWorlds, it's important to be aware that such limits may exist. For the most accurate and up-to-date information, it's recommended to consult the official API documentation or contact LearnWorlds support directly.

Latest API Version

The most recent version of the LearnWorlds API is version 2. Here are the key points about the current LearnWorlds API:

Current API Version

  • The latest version of the LearnWorlds API is version 2 [1].
  • Version 1 of the API is no longer supported [1].

Key Features

  • The API documentation extensively covers the current version, providing access to the latest features and functionalities [1].
  • It includes 26 new API calls to expand school functionalities [2].
  • The API is organized into over 15 categories, covering areas like Courses, User Groups, Multiple Seats, and more [2].

Getting Started

  • To use the API, you need a LearnWorlds school with a Learning Center or higher plan [2].
  • You can find the detailed API documentation (including examples) on the LearnWorlds support site [1].
  • The API uses OAuth 2.0 for authentication [1].

Best Practices

  • It's highly recommended to use the latest API version (v2) as it unlocks new functionalities for integrating learning across your organization [2].
  • While existing integrations with v1 will not be affected, it's encouraged to transition to the new version for future innovations [2].
  • When implementing the API, it's advisable to use a proxy for requests to avoid exposing your client secret [1].

Additional Features

  • The API is complemented by webhook capabilities, offering real-time data transfer for key events [2].
  • LearnWorlds provides code snippets in various programming languages to help with implementation [2].

In summary, LearnWorlds has significantly expanded its API capabilities with version 2, offering a more comprehensive and flexible set of tools for integrating and automating eLearning platforms.

How to get a LearnWorlds developer account and API Keys?

To get a developer account for LearnWorlds and create an API integration, you need to follow these steps:

  1. Sign up for a LearnWorlds account: If you don't already have a LearnWorlds account, you'll need to sign up for one first. Choose a plan that suits your needs.

  2. Access the API settings: Once you have an active LearnWorlds account, log in to your school's admin panel. Navigate to Settings → Developers → API.

  3. Request API credentials: In the API section, you'll find an option to request credentials for using the API. Click on this to submit a request for your API keys.

  4. Receive your API credentials: After submitting the request, LearnWorlds will provide you with the necessary credentials, including:

    • Client ID
    • Client Secret
    • API URL (specific to your school)
  5. Keep your credentials secure: It's crucial to keep your access token and other credentials secret, as they provide access to your LearnWorlds data.

What can you do with the LearnWorlds API?

Based on the search results provided, here is a list of data models you can interact with using the LearnWorlds API, along with what is possible for each:

Affiliates

  • Create an affiliate: Make a user an affiliate using their user ID
  • Get affiliates: Retrieve a list of all school affiliates
  • Get customers per affiliate: Retrieve all customers connected to a specific affiliate
  • Get leads per affiliate: Retrieve all leads connected to a specific affiliate
  • Get affiliate payments: Retrieve a list of all affiliate payments
  • Get completed affiliate payouts: Retrieve completed payouts for a specific affiliate
  • Get due affiliate payouts: Retrieve due payouts for a specific affiliate
  • Get upcoming affiliate payouts: Retrieve upcoming payouts for a specific affiliate

Courses

  • Get information on courses

Users

  • Get user information
  • Single Sign-On (SSO): Redirect users from your website/application to LearnWorlds and log them in seamlessly

Bundles

  • Get information on bundles

Subscriptions

  • Get information on subscriptions

Promotions

  • Get information on promotions

Payments

  • Get information on payments

Certifications

  • Get information on certifications

Authentication

  • Request API credentials
  • Use OAuth2 for API access
  • Obtain and use access tokens for API requests

Webhooks

  • Integrate with various services like Facebook, ESP, and CRMs

While not explicitly mentioned as API endpoints, the search results also indicate that LearnWorlds offers features related to:

  • Marketing tools
  • Interactive video
  • Mobile app building
  • Checkout and payments
  • Live sessions
  • Assessment building
  • Custom user roles
  • Survey building
  • Analytics and reports

These features may have corresponding API endpoints or integrations, but the search results do not provide specific details about API interactions for these data models.