# Quick Start

## Get your API keys

Your API requests are authenticated using API keys. Any request that doesn't include an API key will return an error.

The first step is to create a user account through the Clearinghouse website, <https://clearinghouse.net/registration>.\
Then you can request an API key, <https://www.clearinghouse.net/api-request>.

Once the request is accepted, you will receive an email from `info@clearinghouse.net` with your token.

## Authentication

There are two methods of authentication CRLCA has available:

* Token Authentication
* Session Authentication

The following sections will go over how to make your first request using both authentication methods.

## Token Authentication - Make your first request

Token authentication authenticates based the token you have received via email from `info@clearinghouse.net`.

To make your first request, send an authenticated request to the hello endpoint.

## Get test.

<mark style="color:blue;">`GET`</mark> `https://www.clearinghouse.net/api/v2p1/test`

Test endpoint for API connection verification

#### Headers

| Name                                            | Type   | Description                                                                                                                    |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | <p>Authorization</p><p><code>Token XXXXXXXXXXX</code></p><p>where</p><p><code>XXXXXXXXXXX</code></p><p>is the token string</p> |

{% tabs %}
{% tab title="200 Successfully connected" %}

```javascript
{
"message": "Success, you have access to the Civil Rights Clearinghouse Litigation API!"
}
```

{% endtab %}

{% tab title="401 Permission denied " %}

```javascript
{
    "detail":"Authentication credentials were not provided."
}
```

{% endtab %}
{% endtabs %}

Take a look at how you might call this method using python or `curl`:

{% tabs %}
{% tab title="python" %}

```
import requests

url = "https://clearinghouse.net/api/v2p1/test"
payload = {}
headers = { 'Authorization': 'Token XXXXXXXXXX',
'User-Agent': 'Chrome v22.2 Linux Ubuntu'
}
response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)
```

{% endtab %}

{% tab title="curl" %}

```
curl https://www.clearinghouse.net/api/v2p1/test/ 
    -H 'Authorization: Token XXXXXXXXXXXXXXX'
```

{% endtab %}
{% endtabs %}

## Session Authentication

Session authentication authenticates based on your Civil Rights Clearinghouse Litigation website login credentials.

{% hint style="info" %}
**Recommendation:** Session authentication is a great way to navigate available CRCLA requests using the web browser.
{% endhint %}

To make your first request, make sure you are logged onto your Civil Rights Clearinghouse Litigation account. You can access the authentication request to the following endpoint: [https://www.clearinghouse.net/api/v2p1/test.](https://clearinghouse.net/api/v2/test)

You should see the following the data returned:

`{ "message": "Success, you have access to the Civil Rights Clearinghouse Litigation API!"`


---

# 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://api.clearinghouse.net/quick-start.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.
