# Creating an LMS integration

## Retrieving your Enterprise group ID

To create a developer key in Canvas, you will need to enter your ENGAGE Enterprise group's ID. To retrieve this ID, complete the following steps:

1. In EAP, go to the group that you want to connect to.
2. Select the **Details** tab.
3. On the **Details** tab, select the copy icon for the **Group ID**.

<figure><img src="/files/g0y7MvTt4PRODiVPp87s" alt=""><figcaption><p>Location of the Group ID on the Details page</p></figcaption></figure>

## Creating a developer key in Canvas

{% hint style="warning" %}
To create an API key in Canvas, you must have a root admin account.
{% endhint %}

{% hint style="info" %}
You must create a Canvas developer key for each ENGAGE Enterprise group that you want to integrate with. However, you can create an integration in a parent group, and then have all subgroups use that same integration with the same developer key.
{% endhint %}

To create a developer key, complete the following steps. For more detailed information, refer to [How do I add a developer API key for an account?](https://community.canvaslms.com/t5/Admin-Guide/How-do-I-add-a-developer-API-key-for-an-account/ta-p/259) in the Canvas documentation.

1. In the left-hand menu in Canvas, select **Admin** and then select the name of the root account.
2. In the account navigation, select **Developer keys**.
3. On the **Developer keys** page, select **+ Developer Key**, and then select **API key**.
4. Enter the following information:
   1. In the **Key name** field, enter a name that will help you to identify that the key is used for your ENGAGE Enterprise group quiz integration.
   2. In the **Owner email** field, enter your email address.
   3. In the **Redirect URIs** field, enter `https://prod2.engagevr.io/api/lms/callback?uuid=<group_id>, but replace <group_id>` with the ID from [#retrieving-your-enterprise-group-id](#retrieving-your-enterprise-group-id "mention").
5. Select **Save**.
6. On the **Developer keys** page, in the **State** column, select the toggle for the key that you just created.
7. In the **Turn On Developer Key** confirmation prompt, select **Switch to On**.
8. For the key that you just created, copy the value in the **Details** column. This is the value that you enter in EAP for the **Client ID**.
9. For the key that you just created, select **Show key**, and then copy the key. This is the value that you enter in EAP for the **Client Secret**.

<figure><img src="/files/XAfknVbwOspoDq3t0LCR" alt=""><figcaption><p>Relationship between a Canvas developer key and the fields in an ENGAGE quiz integration</p></figcaption></figure>

## Identifying your Canvas account number

You can choose which Canvas account you want to connect to.

{% hint style="warning" %}
You must connect to the account that includes the quizzes that you will import into ENGAGE and has the users that you want to post results for.
{% endhint %}

To identify the account number, which you will need when you create the integration in EAP, complete the following steps:

1. In the left-hand menu in Canvas, select **Admin** and then select the name of the account.
2. In the address bar of the web browser, identify the number that follows `accounts/`. This is the account number.

For example, the root account will have an address similar to `https://myorg.instructure.com/accounts/1`, where the account number is `1`. A sub-account may have an address similar to `https://myorg.instructure.com/accounts/123`, where the account number is `123`.

## Creating the integration in EAP

1. In EAP, go to the group that you want to connect your LMS.
2. Select the **Quizzes** tab.
3. On the Quizzes tab, select **LMS Integration**.
4. From the list, select **Canvas**.
5. In the **Client ID** field, enter the value from the **Details** column of your Canvas developer key.
6. In the **Client Secret** field, enter the value that is displayed when you select **Show key** for your Canvas developer key.
7. In the **LMS URL** field, enter the address of your Canvas LMS. For example, `https://myorg.instructure.com/`

{% hint style="danger" %}
Ensure that you include the forward slash at the end of the URL
{% endhint %}

8. In the **Account Number field**, enter the Canvas account number that you identified in [#identifying-your-canvas-account-number](#identifying-your-canvas-account-number "mention").
9. Select **Save**.
10. Select **Authenticate**, and then authenticate with your Canvas account details. The account that you use to authenticate must be an admin of the Canvas account that you identified in [#identifying-your-canvas-account-number](#identifying-your-canvas-account-number "mention").
11. On the confirmation window, select **Authorize**. You are returned to the **LMS Integration** page in EAP, and a panel is displayed to indicate that the LMS is connected.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.engagevr.io/enterprise/enterprise-admin-portal/lms-integration-for-quizzes/creating-an-lms-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
