Skip to content

Commit

Permalink
Begin work on http api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bitfl0wer committed Dec 24, 2023
1 parent 23bbdd2 commit c6faef9
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions docs/Server-Client API/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Server-Client API

### Authorization

**Bearer token**, unless specified otherwise.

### Server

`http://localhost:3001/api`

---

## Federation tokens

Routes concerning the creation, deletion and management of federation tokens.

### <p class="request-h"><span class="request request-get">GET</span> Generate Federation Token</p>

`http://localhost:3001/api/federation/token`

Ask your home server to generate a federation token for you. You can use this token to authenticate on another server.

The token is signed using the home server's public signing key, so that other servers can verify its authenticity.

#### Body

```json
{
"server": "https://server.example.com"
}
```

#### Response

=== "200 OK"

##### Body

```json
"exampletoken"
```

=== "404 Not Found"

##### Body

```json
{
"errcode": "PR_NOT_FEDERATED",
"error": "The server you are trying to generate a token for does not federate with this server. Either this server does not have federation enabled or at least one of the servers has denied federation with the other. Check with a server administrator for more information."
}
```

0 comments on commit c6faef9

Please sign in to comment.