Skip to content

Commit 81d48fd

Browse files
committed
Updated docs to support the latest v4 api update
1 parent 9f8d7b0 commit 81d48fd

File tree

4 files changed

+46
-10
lines changed

4 files changed

+46
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docs.waifu.it",
3-
"version": "3.0.5",
3+
"version": "3.0.6",
44
"description": "The new and improved documentation for Waifu.it",
55
"scripts": {
66
"dev": "next dev",

pages/faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<br />
44

55
### How do I get the API token?
6-
- To get your API token, join this [discord server](https://discord.gg/yyW389c), then type `-claim` in [#bot-commands](https://discord.com/channels/479300008118714388/800784815908454452), fill the questions asked by `@Kohai` in DM, and receive your token.
6+
- To get your API token, just login to [dashboard](https://waifu.it/dashboard)
77

88
{/* ### CORS causing trouble?
99

pages/rest-api/Images/Waifu/search.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ The request to the `/waifu` endpoint should be a JSON object with the following
3333
| --------------- | ------- | ---------------------------------------------------- | -------- |
3434
| `Authorization` | string | The unique identifier of the user sending the request. | True |
3535

36+
### Parameters
37+
38+
The request parameters for the `/waifu?{parameter}={value}` endpoint.
39+
40+
| Parameter | Type | Description | Required |
41+
| ----------| ------ | ----------------------------------------------------- | -------- |
42+
| `name` | string | (Optional) The desired character name for the query. If not provided, a random waifu will be generated. | False |
43+
| `anime` | string | (Optional) The desired anime name for the query. If not provided, a random waifu will be selected. | False |
44+
3645
### Example Request
3746
Here's example of how to make a request to the `/waifu` endpoint.
3847

pages/rest-api/start.mdx

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,46 @@
1-
import { Tab, Tabs } from "nextra-theme-docs";
1+
import { Tab, Tabs,Callout } from "nextra-theme-docs";
2+
23

34
# Get Started
5+
## Base URL
6+
7+
```
8+
https://waifu.it/api
9+
```
10+
11+
## API Versioning
12+
13+
<Callout type="error" emoji="">
14+
Some API and Gateway versions are now non-functioning, and are labeled as discontinued in the table below for posterity.
15+
Trying to use these versions will fail and return 400 Bad Request.
16+
</Callout>
17+
18+
Waifu.it exposes different versions of our API. You should specify which version to use by including it in the request path
19+
like `https://waifu.it/api/v{version_number}`. Omitting the version number from the route will route requests to the current
20+
default version (marked below). You can find the change log for the newest API version [here](https://github.com/WaifuAPI/api/releases).
21+
22+
**API Versions**
23+
24+
| Version | Status | Default |
25+
|---------|--------------|---------|
26+
| 4 | Available ||
27+
| 3 | Deprecated | |
28+
| 2 | Discontinued | |
29+
| 1 | Discontinued | |
430

5-
The base URL for the Waifu.it REST API is: [`https://waifu.it/api/:endpoint`](https://waifu.it/api)
6-
- Replace `:endpoint` with the endpoint you want response from.
731

832
## Authentication
933

10-
- Use the API token that you generate to authenticate each request made to the API.
34+
Authenticating with the Waifu.it API can be done using a token found on the **Dashboard** page within your settings.
35+
If you don't have an API token, then just head over to https://docs.waifu.it/faq, then read and get one for free.
36+
37+
For all authentication types, authentication is performed with the `Authorization` HTTP header in the format `Authorization: TOKEN`.
1138

12-
> If you don't have an API token, then just head over to https://docs.waifu.it/faq, then read and get one for free.
39+
**Example Token Authorization Header**
1340

14-
**Request Header**
15-
>
16-
> - Set your API token as the `Authorization` header on every request.
41+
```
42+
Authorization: MTk4NjIyNDgzNDcxOTI1MjQ4.Cl2FMQ.ZnCjm1XVW7vRze4b7Cq4se7kKWs
43+
```
1744

1845

1946
**Request Samples**

0 commit comments

Comments
 (0)