Use Skilljar with Zapier to automate your training program and connect to hundreds of external platforms without the use of any code. In this article, we’ll explain how to trigger automation in Zapier when a training event occurs in Skilljar, and how to use that event data to take an action in an external system. We’ll also explain how to make API requests from Zapier to Skilljar to pull, update, or create training data when an event from an external system triggers the automation.
- Note: Making API calls from Zapier to Skilljar requires the “Webhooks by Zapier” Premium App. Premium Apps require the paid “Starter” plan (or higher) in Zapier, so make sure you check in on that before getting started. Not sure what Zapier plan you have? Login to Zapier to find out.
To read more about Zapier, see our Skilljar on Zapier 101 article.
Using a Skilljar Event as the Zap Trigger
A Zap can be triggered by using either the native Skilljar app or the custom webhook app in Zapier. If you want to trigger the Zap when a domain enrollment (student sign-up), course enrollment, or course completion event occurs in Skilljar, use the native Skilljar app since it is easier to set up. For all of the other Webhook events that the Skilljar API supports, such as lesson completion or VILT registration, use a custom webhook.
What should I use? Skilljar Zapier App vs Custom Webhooks:
Skilljar Zapier App |
Custom Webhook |
|
Events Supported |
|
|
Level of Effort |
Plug-and-play |
Manual steps required |
Setup Process |
Follow instructions below |
|
Plan Required |
Free or higher |
Starter or higher |
Zap Trigger: Using the native Skilljar Zapier App
When creating a new Zap, you can access the Skilljar Zapier App with the following steps:
-
In Zapier, select Create, then New Zap, and search ‘Skilljar’ in the Trigger-section.
- Choose the Skilljar event that you want to use as the trigger for the flow in the ‘Event’ dropdown, and select Continue.
- If you’re using the Skilljar Zapier app for the first time, you’ll be prompted to authenticate to your Skilljar account by selecting Connect to a new account.
- A pop-up window will prompt you to authenticate to Skilljar by providing your Skilljar API-key. Select Yes, Continue. You can access or create new API-keys on your Skilljar Dashboard.
- Zapier will automatically test that your API key. If it works, you'll be allowed to continue setting up your Zap.
- You only have to authenticate the first time you’re using the Skilljar Zapier app. You’ll then be able to re-use this same Skilljar account in other flows using the app by selecting the account from the dropdown menu.
-
Note: If there’s an error with the API-key, you’ll see the “we hit an error adding your new account” error message:
- Zapier will automatically test that your API key. If it works, you'll be allowed to continue setting up your Zap.
- Test the trigger - you should see a sample event at the bottom of the window. This tells you that the webhook listener is working correctly and you can move on to set up the Actions in whatever apps you’re looking to connect to your Zap.
Zap Trigger: Using a Custom Webhook Event
If you want to trigger a Zap on based on a Skilljar webhook event that isn’t currently supported by the native Zapier app, you can set up a Custom Webhook event. These include:
- Lesson completion
- Path enrollment
- Path completion
- Purchase fulfillment
- Quiz completion
- VILT registration.
This process requires some manual actions to be taken, but is a simple one-time setup. You can do this following these steps:
-
In Zapier, select Create and then New Zap. In the Trigger search field, select Webhooks by Zapier.
-
Select Catch Hook from the Event dropdown and then continue.
- In the “Set up trigger” section, select continue and leave the “Pick off a Child Key” field blank.
-
In the “Test trigger” section, copy the custom webhook web address/URL created by by selecting Copy. to copy the address.
-
Go to the Skilljar API Documentation Webhook > Create page and select Try it out! in the top right corner. A widget will allow so you can set up the custom webhook to Zapier.
- Paste the Zapier webhook URL into the “Target url” field.
-
Select the Active checkbox and choose the event you want to trigger from the “Event type” dropdown.
- Note: leaving “Event type” dropdown blank will trigger the automation with every event type.
- Select Send Request in the bottom right.
-
In the pop-up window, enter your *Skilljar API key into the “Username” field. Leave the “Password” field blank, and select Sign In.
- *Note: If you don’t already have a Skilljar API key, you create one by going to the Organization -> API Credentials page in the Skilljar Admin Dashboard. You can create as many API keys as you’d like, and it is best practice to create a key per automation workflow so you can safely remove them later if the need arises.
- Your custom webhook to Zapier is now configured, and you should see a successful response from the Skilljar API on the right of the “Try it out!” panel.
-
Return to the Zap created in Step 1 and select Test trigger. Zapier is now listening for test events, so you can generate one in your Skilljar account as a student for the specific event you configured. For example, the below screenshot shows a successful “lesson completion” event:
The custom webhook event from Skilljar to Zapier is now set up and every event that is generated Skilljar from this point forward that matches it will trigger this Zap (when it’s turned on). You can now move into the Actions stage of setting up your Zap.
Zap Action: Making API Calls to Skilljar to Pull, Update, or Create Training Data
The “Webhooks by Zapier” app can be used in the Action section of a Zap to make custom API calls out to external services like Skilljar. This app supports functionality to make GET (pull data), PUT (update data), and POST (create data) API requests, which is useful for a variety of automation tasks. This app can also use any data sent in the original Zap Trigger, such as Student ID, Student Email, Course/Lesson ID when making these requests.
In the following examples, we’ll explain how to build a Zap where a student completes an action in an app outside of Skilljar, which will then call the Skilljar API to add them to a Group. To do this we are going to leverage the Skilljar API by:
- Retrieving the student email from a connected Google Sheet where it is stored.
- Using a GET-method to call the Skilljar API to find a specific student ID based on their email.
- Using a POST-method to call the Skilljar API to create a new group membership entry for that student.
This provides you with the blueprint you’ll need to set up Skilljar API calls on Zapier to automate your workflows containing your training data.
GET Request: Pulling Training Data
In this example, a user has completed an action in an app outside of Skilljar and we have the student’s email address. Next, we need to get the student’s Skilljar ID using the Skilljar API to query by student email. This Student ID will be important later in the POST request example to create a new group membership for the student. Skilljar POST requests require Student ID instead of email as an input.
-
First, we need to identify the appropriate API-endpoint to query the Student ID. To find the endpoints, refer to our API Documentation. In this case we’re using ‘Users’ > ‘List’-endpoint. You can try testing the API-call and seeing what are the required parameters by selecting Try it out!
-
Next, we’re going to capture the URL for the API-endpoint we’re using. The URL consists of two parts: ‘https://api.skilljar.com/’ and ‘<SPECIFIC METHOD YOU’RE USING>.’ For example, list all Skilljar-users: https://api.skilljar.com/v1/users. You can see an example where to get the extension and the type of method (GET/POST) in the below screenshot. We’ll use both of these later in the flow, so make sure to keep this tab open or note down this information:
- On Zapier, in the ‘Action’-section we’re selecting ‘Webhooks By Zapier’ as the App Event. This enables us to fire off a single API-request with optional query strings from Zapier to other applications like Skilljar.
-
In the Event-dropdown select the type of API-call that you’re using. You can find this in our API-documentation, as explained in Step 2. Listing all Skilljar-students is a GET-method.
-
The ‘Choose app & event’ options in the Action-menu should now look like in the screenshot below:
-
Next, we’re going to set up the Action itself, which is to query the Skilljar API to get the student ID for a specific student email address. For the URL-field, copy and paste the API-endpoint URL from step 2.
-
We can use ‘Query String Params’ to specify optional parameter-values to filter the query results. In the below screenshot, we’re using Google Sheets to capture the data and pick the user’s email from there. However, you can capture the email from a webhook response coming from any other external application where the student took the action and that triggered the flow. If we wanted to query all Skilljar-students, we could leave the field empty.
-
For other Endpoints which dont have email as the query string, this can also be used to leverage any parameters available in the API documentation (search, etc)
-
For other Endpoints which dont have email as the query string, this can also be used to leverage any parameters available in the API documentation (search, etc)
-
The last step with the GET-request is to select the response-format settings and authentication:
- Send as JSON = No
- JSON key = json
- Unflatten = Yes
-
Basic Auth = API-key + pipe character (‘|’)
- Note: Remove all spaces before and after the pipe character
- If you don’t already have a Skilljar API key, you create one by going to the Organization -> API Credentials page in the Skilljar Admin Dashboard. You can create as many API keys as you’d like, and it is best practice to create a key per automation workflow so you can safely remove them later if the need arises.
-
Headers:
- ‘Content-Type’ : ‘application/json’
-
Once we’ve added all the field-values, we can move to testing the Action by selecting Continue.
- The final step in querying for the Student ID associated with a specific student email is to test that the flow works as expected. In the first screen we can review all the input parameters we defined in the previous step. Once we select Test action, Zapier will send the request to the Skilljar API along with the input parameters. This test will generate an API response containing the student ID that matches the email filter, as well as other information about the student.
POST Request: Creating Training Data
In this example, we’ll explain how to create a new group membership for the Student ID extracted from the GET request example above. This example will use a POST request, which you must configure as a CUSTOM request in Zapier using the “Webhooks by Zapier” app.
-
- Note: Since the Skilljar API requires nested JSON in the POST body of an API request, the native “Webhooks by Zapier” POST event type can’t be used. Instead, we need to select the “Custom Request” event type and then choose “POST” as the request type which is detailed in the steps below.
- ALL spaces, line breaks, and trailing JSON commas must be removed for the request to work.
-
In the “Action” section of your Zap, select Webhooks by Zapier, choose Custom Request as the event type and then select Continue:
-
In the “Set Up Action” section, configure the fields as follows:
- Method = POST
-
URL = Skilljar API endpoint URL. In this case, https://api.skilljar.com/v1/groups/{group_id}/users
- Refer to Step 3 below for detailed setup instructions.
- Replace {group_id} in the URL with the Skilljar Group ID you want to add this Student to. Example: https://api.skilljar.com/v1/groups/1tfjy6rahse18/users
- Data Pass-Through? = False
-
Data = JSON POST body for API request. In this case: {"user":{"id":"abcde12345"}}
- Refer to Step 4 below for detailed setup instructions.
- Be sure to remove any spaces, newlines, or trailing commas from your JSON or the Skilljar API will return a formatting error.
- Unflatten = Yes
-
Basic Auth = API-key + pipe character (‘|’)
- Note: Remove all spaces before and after the pipe character
- If you don’t already have a Skilljar API key, you create one by going to the Organization -> API Credentials page in the Skilljar Admin Dashboard. You can create as many API keys as you’d like, and it is best practice to create a key per automation workflow so you can safely remove them later if the need arises.
-
Headers:
- ‘Content-Type’ : ‘application/json’
- To configure the “URL” field in the POST request, we need to pass in the Skilljar API URL associated with what we are trying to do. This URL consists of two parts: ‘https://api.skilljar.com/’ + ‘<SPECIFIC METHOD YOU’RE USING>’.
- You can find the URL for the API call you want to use in the Skilljar API documentation:
- For example, to add a Student to a Group the URL would be: https://api.skilljar.com/v1/groups/{group_id}/users.
- Before adding this URL to Zapier, you first need to replace any macros in the URL with their associated IDs from Skilljar. A macro will be surrounded in curly braces and look like this: {group_id}
- You can find this value by navigating to the associated object in the Skilljar Admin Dashboard, selecting it, and then pulling the value at the end of the URL:
- In this case, the formatted URL to add to Zapier with macros replaced would be: https://api.skilljar.com/v1/groups/p9dtyhwvsaa0/users.
- You can find the URL for the API call you want to use in the Skilljar API documentation:
-
When making a POST API request, we need to include a “body” parameter that contains a JSON representation of the data we are trying to create. To give you a head start here, Skilljar API endpoints that support POST will generally have an example POST body available for reference in the documentation. For example, in the documentation Groups > Users > Create API endpoint from the use case above, we can see the following example JSON POST body:
- This POST body contains a “user” object with an “id” field set to a value of “abcde12345”. This essentially tells the Skilljar API to add the user with ID “abcde12345” to the {group_id} configured in the request URL.
- When using Zapier to submit a POST body to the Skilljar API, there are some formatting requirements that are important to avoid any issues. Specifically, be sure to remove any spaces, newlines, or trailing commas from your JSON or the Skilljar API will return a formatting error.
-
Using the example above, the formatted POST body to enter into Zapier with new lines, spaces, and trailing commas removed would look as follows:
- {"user":{"id":"abcde12345"}}.
-
To make this clearer, below you will find the POST body copied from the Skilljar API documentation with the characters that had to be removed to create the correct formatting for Zapier:
- {
- "user":{
- "id":"abcde12345"
- }
- }
3. The final step to create a group membership for a student using POST is to test that the flow works as expected. After we select Test action, Zapier will send the request to Skilljar API along with the POST body parameters. Check for a successful response in Zapier after your test has been made, and then log in to the Skilljar Admin Dashboard to ensure the data shows up how you expect it to.