---
title: "How to Use Quepid&#39;s API"
url: "https://quepid-docs.dev.o19s.com/2/quepid/55/how-to-use-quepid-s-api"
---

# How to Use Quepid's API

> Navigate to https://go.quepidapp.com/api/docs to see the documentation on the API and try it out

Accessing the Quepid API like http://localhost:3000/api/cases/5.json is protected by you logging in and having the appropriate cookies set. 

But what if we want to have an automated process?   Then you need to create a Personal Access Token.

Go to your Profile page and scroll down to the _Personal Access Tokens_ section:
 ![pan_token.png](https://quepid-docs.dev.o19s.com/u/pan_token-sutg3g.png) 

Click the _Generate New Token_ and you will get a token that is specific to you that lets you interact with Quepid's API:

 ![pan_token2.png](https://quepid-docs.dev.o19s.com/u/pan_token2-TP4ur7.png) 

Here is an example of looking up information about a Case by it's id:

```
curl -X GET -H 'Authorization: Bearer 53e41835979d649775243ababd4312e8' http://localhost:3000/api/cases/5.json
>> {"name":"Book of Ratings","book_id":1,"query_doc_pairs":[{"query_doc_pair_id":1,"position":1,"query":"adsf","doc_id":"asdf","judgements":[]}]}%
```

Here is an example of creating a query doc pair for a book by it's ID:

```
curl -X POST http://localhost:3000/api/books/2/query_doc_pairs/ -H 'Authorization: Bearer 4a82040bf1b2d255c63833cb59fa9275' -H 'Content-Type: application/json' -d '{
  "query_doc_pair": {
    "document_fields": "{title:My Document}",
    "query_text": "my search",
    "doc_id": "some_special_doc_id_52",
    "position": 1
  }
}'
```
And of course an example of programmatically creating a judgement:

```
curl -X POST http://localhost:3000/api/books/2/judgements/ -H 'Authorization: Bearer 4a82040bf1b2d255c63833cb59fa9275' -H 'Content-Type: application/json' -d '{
  "judgement": {
    "query_doc_pair_id": 201
    "rating": 1
  }
}'
```



