Skip to content

Commit

Permalink
Update rest-api.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander authored Jun 26, 2024
1 parent 993ce4f commit 2676230
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions cloud/docs/rest-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This page documents the REST API that every database in Dexie Cloud has.
## Endpoints

| [/token](#token) | Token endpoint |
| [/token/validate](#token-validate) | Token validation endpoint |
| [/all/...](#all-endpoint) | All data endpoint |
| [/my/...](#my-endpoint) | My data endpoint |
| [/public/...](#public-endpoint) | Public data endpoint |
Expand Down Expand Up @@ -132,6 +133,34 @@ The token is valid in one hour from the time it was requested.
- [Tokens](authentication#tokens)
- [Example auth integration](<db.cloud.configure()#example-integrate-custom-authentication>)

### /token/validate

| Method | GET |
| Authorization | Bearer token |

Validates a JWT token.

```http
GET /token/validate HTTP/1.1
Host: xxxx.dexie.cloud
Origin: <the origin header from your client>
Authorization: Bearer <JWT token>
```

Expected result:

```http
HTTP/1.1 200 Ok
Content-Type: application/json
{
valid: true,
claims: {
...claims
}
}
```

### /all/... endpoint

**Get all objects in given table:**
Expand Down

0 comments on commit 2676230

Please sign in to comment.