> For the complete documentation index, see [llms.txt](https://docs.navigaglobal.com/circulation-setup-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.navigaglobal.com/circulation-setup-manual/system/security-menu/generate-access-key.md).

# Generate Access Key

Access keys, also known as API keys, aid in ensuring the safety and management of API (Application Programming Interface) access. They provide benefits such as:

1. Access keys provide an effective way to authenticate users or accounts when accessing an API. This ensures that only authorized groups can interact with the API, ensuring the security of the data.
2. API keys can be revoked or regenerated if they are compromised, which helps minimize security threats.

Publishers who want to give third-party vendors access to the Circulation API can create a user ID and generate an access key through which the third-party vendor can access the database securely.

* The users can define whether an access key is required to access the application based on the Business Rule— ***Should the CIRC API require a valid access key be passed to it?*** (*CircAPI* section). The default value of the BR is set to ***Yes***. If the value of this BR is set to ***Yes***, the Access Key must be provided along with the User ID for each Circ API call.

To retrieve the account information using the Distribution API, a client must first create an account and then generate an Access Key for the account. In the URL request to the Distribution API web server, both the Account ID and the Access Key must be provided.

* The users can define whether an access key is required to access the application based on the Business Rule— ***Should the Distribution API require a valid access key be passed to it?*** (*Distribution - API: General* section (CMO)). The default value of the BR is set to ***No***. If the value of this BR is set to ***Yes***, the Access Key must be provided along with the account ID for each Distribution API call.

If the access key has not been provided and the above-mentioned BRs have been set to *Yes*, an authentication failed error message will be displayed.

{% hint style="danger" %}
**Note:**

*To revoke access for a particular user, create a new access key for that user and do not share the key. Because only one access key is valid/stored at a time, this will disable access to the system using the previous access key.*&#x20;
{% endhint %}

### To generate the access key:

1. In character Circulation, select **Generate Access Key** from the Security menu to display the Generate Access Key screen.<br>

   <figure><img src="https://2165740141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5MIKWQvI2WSa0XQfA9VW%2Fuploads%2FrxSy9H5reZepUq1oJRuF%2Fimage.png?alt=media&amp;token=fb4fa88d-ca4a-4a8f-bd24-0ec56275cd46" alt=""><figcaption></figcaption></figure>

2. Select **Add** and complete the following fields.<br>

   <table><thead><tr><th width="160">Field</th><th width="91">Type</th><th>What to enter</th></tr></thead><tbody><tr><td>APPLICATION</td><td>setup</td><td>Enter the application name as either <strong>Circulation API</strong> or <strong>Distribution API</strong>. For help, press F2.</td></tr><tr><td>USER ID</td><td>open</td><td><p>If the <em>Application</em> selected is the <em><code>Circulation API</code></em>, this field will be displayed.</p><p>Enter a valid user ID or press F2 for help. </p></td></tr><tr><td>ACCOUNT ID</td><td>open</td><td><p>If the <em>Application</em> selected is the <em><code>Distribution API</code></em>, this field will be displayed.</p><p>Enter a valid account ID or press F2 for help.</p></td></tr><tr><td>ACCESS KEY</td><td>display</td><td>This will be generated automatically and displayed on the screen.</td></tr><tr><td>START DATE<br>END DATE</td><td>date</td><td><p>Enter the date range for which the user will be able to access the application.</p><p><br><strong>Note:</strong></p><ul><li>The Start Date will be set to Today by default.</li><li>Enter a date that is later than Today as the End Date. For help, press F2.</li></ul></td></tr></tbody></table>

3. Select **Accept** to provide access to the specified user or account.
   * Application: **Circulation API**

     <figure><img src="https://2165740141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5MIKWQvI2WSa0XQfA9VW%2Fuploads%2Fxj335Jjvmwdn7merhyyS%2Fimage.png?alt=media&amp;token=87d97090-e237-4d9d-b96c-728f906b3b1d" alt=""><figcaption></figcaption></figure>

   * Application: **Distribution API**<br>

     <figure><img src="https://2165740141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5MIKWQvI2WSa0XQfA9VW%2Fuploads%2FlWtIFqeiY2wPoK8B2HrK%2Fimage.png?alt=media&amp;token=03d01658-b2d6-46fd-aafb-33b5f0f433c8" alt=""><figcaption></figcaption></figure>

### Example

{% tabs %}
{% tab title="Positive Scenario" %}
To successfully access the database through the CircAPI or the account details through the Distribution API, either of the below options can be followed:

* The value of the BR has been set to Yes, and a valid access key has been provided in the request URL.\
  ***Or***
* &#x20;The value of BR has been set to No.

#### Examples

* Application: **Circulation API**<br>

  <figure><img src="https://2165740141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5MIKWQvI2WSa0XQfA9VW%2Fuploads%2FYMsJmQgtqL9a8ra2lL81%2Fimage.png?alt=media&amp;token=3b70a91d-b8c2-45bb-ad02-0ce7004f0ae3" alt=""><figcaption></figcaption></figure>

* Application: **Distribution API**<br>

  <figure><img src="https://2165740141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5MIKWQvI2WSa0XQfA9VW%2Fuploads%2Fi1TlUjtXGRdy634W1TrJ%2Fimage.png?alt=media&amp;token=a5810d3b-01ad-4ef5-b238-1243d98d6bf1" alt=""><figcaption></figcaption></figure>

{% endtab %}

{% tab title="Negative Scenario" %}
If the value of BRs has been set to Yes and an invalid or blank value for access key has been provided for either the UserID or AccountID, an error will be returned.

#### Examples

* Application: **Circulation API**<br>

  <figure><img src="https://2165740141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5MIKWQvI2WSa0XQfA9VW%2Fuploads%2FnWBCeg3mkFkeL8YHGIk4%2Fimage.png?alt=media&amp;token=e6c9595a-9994-480f-bf69-6b06084198f2" alt=""><figcaption></figcaption></figure>
* Application: **Distribution API**<br>

  <figure><img src="https://2165740141-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5MIKWQvI2WSa0XQfA9VW%2Fuploads%2FvnIZOfrcWgfk1SSOjqFY%2Fimage.png?alt=media&amp;token=863285b3-04a9-4e47-8b52-0c178a711776" alt=""><figcaption></figcaption></figure>

{% endtab %}
{% endtabs %}
