FAQ content

API: Overview of the LibWizard API

In this article

What is an API?

The LibWizard API (Application Programming Interface) allows you to display your LibWizard content outside of your system. Generally speaking, web developers can use APIs to request data from an external system (in this case, LibWizard), which can then be used in their own web application or script. Requests are made using various endpoints, which are accessible to Admin users by going to Admin > API.

Please note that the API only allows for HTTP GET requests. It is not currently possible to POST data to a form, survey, quiz, or tutorial using the API.


API Authentication

The LibWizard API uses OAuth 2.0 for authentication and supports the Client Credentials grant type. The ideal design would be for your client applications to communicate with your own server, and your server can communicate with the LibWizard API keeping your client id/secret pair out of the public domain.

However, cross-origin resource sharing is allowed from any domain so if you want to set up a read-only application it is possible to expose the client id/secret pair and have the client directly communicate with the LibWizard API. It is strongly advised that when setting up an application with write permissions you keep the client id/secret private. For increased security and efficiency, the API should be accessed via HTTPS directly.

To create a new application:

  1. Go to Admin > API and click on the API Authentication tab.
The API Authentication tab on the API Settings page
  1. Under Applications, click on the Create New button.
  2. In the Create Application window, enter an Application Name. This is just used to help identify it in the list of applications.
  3. Enter an Application Description. This helps describe the purpose of the application and also displays in the list.
  4. Click the Save button to create your application.
The Create New button and Create Application window
  1. The Client ID and Client Secret for your app will appear in the Applications table.
  2. To obtain an access token, you will need to send a request to the /api/v1/oauth/token endpoint for your site's API, along with your application's Client ID and Client Secret. You'll find this information in the Obtaining an Access Token box.
  3. Once your application obtains a token, you'll need to provide it with your API request in the Authorization header. You can find an example for your site in the Authorizing your API Requests box.
An application's ID, secret, and access token request details

API Endpoints

To view the technical documentation for each endpoint, including available parameters, example requests, and sample response data, please log into your LibWizard system and go to Admin > API. Then, under the Endpoints tab, click on the URL of an endpoint to view its documentation.

Below is a brief summary of the available endpoints, just to give you an idea of what you can do with the API.

Description of available API endpoints
Endpoint What it does
/forms Returns a list of all forms, surveys, quizzes, and tutorials in your system, along with the metadata for each (i.e. name, owner ID, creation date, and the number of submissions, to name a few). This does not include fields or submission data.
/content/forms Returns a list of all forms in your system, along with the metadata for each (i.e. name, owner ID, creation date, and the number of submissions, to name a few). This does not include fields or submission data.
/content/surveys Returns a list of all surveys in your system, along with the metadata for each (i.e. name, owner ID, creation date, and the number of submissions, to name a few). This does not include fields or submission data.
/content/quizzes Returns a list of all quizzes in your system, along with the metadata for each (i.e. name, owner ID, creation date, and the number of submissions, to name a few). This does not include fields or submission data.
/content/tutorials Returns a list of all forms in your system, along with the metadata for each (i.e. name, owner ID, creation date, tutorial type, and the number of submissions, to name a few). This does not include fields, slides, or submission data.
/forms/:id This returns the details of a specific form, survey, quiz, or tutorial by its ID (which can be retrieved from the above endpoints). This not only includes its metadata but also fields and their properties.
/submissions/:id This returns the submission data for a specific form, survey, quiz, or tutorial by its ID (which can be retrieved from the above endpoints).