Skip to content

Commit 68100d4

Browse files
committed
Added documentation for the endpoints
1 parent 22d62cb commit 68100d4

File tree

5 files changed

+377
-4
lines changed

5 files changed

+377
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
owo WIP
1+
The developer hasn't provided documentation yet. Reach them at -> [Discord](https://discord.gg/yyW389c)
Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,117 @@
1-
owo WIP
1+
import { Tab, Tabs } from "nextra-theme-docs";
2+
3+
# Search
4+
5+
This endpoint allows you to access and retrieve information about your favorite facts. To access the `/fact` endpoint, you
6+
will need to provide the proper authentication using the Authorization header.
7+
8+
9+
## Endpoint Details
10+
The `/fact` endpoint allows you to retrieve information about a specific fact.
11+
12+
- **URL**: `/fact`
13+
- **Method**: GET
14+
- **Content Type**: application/json
15+
16+
## Authentication
17+
18+
To make requests to the `/fact` endpoint, you must include an `Authorization` header in your API calls. This header should contain a valid access token.
19+
20+
### Example Authorization Header
21+
22+
```jsx
23+
Authorization: YOUR_ACCESS_TOKEN
24+
```
25+
26+
Replace `YOUR_ACCESS_TOKEN` with the actual token provided to you.
27+
28+
## Request Headers
29+
30+
The request to the `/fact` endpoint should be a JSON object with the following headers:
31+
32+
| Header | Type | Description | Required |
33+
| --------------- | ------- | ---------------------------------------------------- | -------- |
34+
| `Authorization` | string | The unique identifier of the user sending the request. | True |
35+
36+
### Example Request
37+
Here's example of how to make a request to the `/fact` endpoint.
38+
39+
<Tabs items={["JavaScript", "Python"]}>
40+
<Tab>
41+
```js
42+
import axios from "axios";
43+
44+
/*
45+
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
46+
*/
47+
const url = "https://fact.it/api/fact";
48+
const data = async () => {
49+
try {
50+
const { data } = await axios.get(url, { headers: {
51+
Authorization: "YOUR_ACCESS_TOKEN",
52+
} });
53+
return data;
54+
} catch (err) {
55+
throw new Error(err.message);
56+
}
57+
};
58+
59+
console.log(data);
60+
```
61+
</Tab>
62+
<Tab>
63+
```python
64+
import requests
65+
66+
"""
67+
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
68+
"""
69+
url = "https://waifu.it/api/fact"
70+
response = requests.get(url, headers={
71+
"Authorization": "YOUR_ACCESS_TOKEN",
72+
})
73+
data = response.json()
74+
75+
print(data)
76+
```
77+
</Tab>
78+
</Tabs>
79+
80+
Remember to replace `YOUR_ACCESS_TOKEN` with your actual access token.
81+
82+
## Responses
83+
84+
The server will respond with an appropriate message based on the input provided. A successfully API request will respond
85+
with a JSON object containing the following information:
86+
87+
- `_id`: The unique identifier of the fact.
88+
- `fact`: This pertains to various facts and information related to anime and related topics.
89+
- `status`: Response status
90+
91+
<Tabs items={["200 OK", "404 Not Found", "500 Internal Server Error"]}>
92+
<Tab>
93+
**Content Type:** `application/json`
94+
```json copy=false
95+
"_id": 48,
96+
"fact": "TEZUKA Osamu is the most famous manga artist in Japan."
97+
"status": 200,
98+
```
99+
</Tab>
100+
<Tab>
101+
**Content Type:** `application/json`
102+
```json copy=false
103+
"status": 404,
104+
"message": {}
105+
```
106+
</Tab>
107+
<Tab>
108+
**Content Type:** `application/json`
109+
```json copy=false
110+
"status": 500,
111+
"message": {}
112+
```
113+
</Tab>
114+
</Tabs>
115+
116+
This documentation should help you use [`axios`](https://www.npmjs.com/package/axios) for Node.js and [`requests`](https://pypi.org/project/requests/)
117+
for Python to interact with the `/fact` endpoint.
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
import { Tab, Tabs } from "nextra-theme-docs";
2+
3+
# Search
4+
5+
This endpoint allows you to generate owoified text. To access the `/owoify` endpoint, you
6+
will need to provide the proper authentication using the Authorization header.
7+
8+
9+
## Endpoint Details
10+
The `/owoify` endpoint allows you to retrieve information about a specific owoify.
11+
12+
- **URL**: `/owoify`
13+
- **Method**: GET
14+
- **Content Type**: application/json
15+
16+
## Authentication
17+
18+
To make requests to the `/owoify` endpoint, you must include an `Authorization` header in your API calls. This header should contain a valid access token.
19+
20+
### Example Authorization Header
21+
22+
```jsx
23+
Authorization: YOUR_ACCESS_TOKEN
24+
```
25+
26+
Replace `YOUR_ACCESS_TOKEN` with the actual token provided to you.
27+
28+
## Request
29+
### Headers
30+
31+
The request to the `/owoify` endpoint should be a JSON object with the following headers:
32+
33+
| Header | Type | Description | Required |
34+
| --------------- | ------- | ---------------------------------------------------- | -------- |
35+
| `Authorization` | string | The unique identifier of the user sending the request. | True |
36+
37+
### Parameters
38+
39+
These are the request parameters for the `/owoify` endpoint.
40+
41+
| Parameter | Type | Description | Required |
42+
| --------- | ------ | ------------------------------------------------------------------ | -------- |
43+
| `text` | string | The text you want to convert into an "owo" language-style format. | True |
44+
45+
## Example Request
46+
Here's an example of how to make a request to the `/owoify` endpoint.
47+
48+
<Tabs items={["JavaScript", "Python"]}>
49+
<Tab>
50+
```js
51+
import axios from "axios";
52+
53+
/*
54+
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
55+
*/
56+
const url = "https://waifu.it/api/owoify";
57+
const text = "Hello world"; // Replace with your desired owoify length (optional).
58+
const data = async () => {
59+
try {
60+
const { data } = await axios.get(url, {
61+
headers: {
62+
Authorization: "YOUR_ACCESS_TOKEN",
63+
},
64+
params: {
65+
text: text || undefined,
66+
}
67+
});
68+
return data;
69+
} catch (err) {
70+
throw new Error(err.message);
71+
}
72+
};
73+
74+
console.log(data);
75+
```
76+
</Tab>
77+
<Tab>
78+
```python
79+
import requests
80+
81+
"""
82+
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
83+
"""
84+
url = "https://waifu.it/api/owoify"
85+
86+
text = "Hello world" # Replace with your desired owoify length (optional).
87+
88+
params = {
89+
"text": text if text is not None else None,
90+
}
91+
92+
response = requests.get(url, headers={
93+
"Authorization": "YOUR_ACCESS_TOKEN",
94+
}, params=params)
95+
96+
data = response.json()
97+
98+
print(data)
99+
```
100+
</Tab>
101+
</Tabs>
102+
103+
Remember to replace `YOUR_ACCESS_TOKEN` with your actual access token.
104+
105+
## Responses
106+
107+
The server will respond with an appropriate message based on the input provided. A successfully API request will respond
108+
with a JSON object containing the following information:
109+
110+
- `owoify`: The owoified that is generated for you.
111+
- `status`: Response status
112+
113+
<Tabs items={["200 OK", "404 Not Found", "500 Internal Server Error"]}>
114+
<Tab>
115+
**Content Type:** `application/json`
116+
```json copy=false
117+
"text": "Hewwo wowwd"
118+
"status": 200,
119+
```
120+
</Tab>
121+
<Tab>
122+
**Content Type:** `application/json`
123+
```json copy=false
124+
"status": 404,
125+
"message": {}
126+
```
127+
</Tab>
128+
<Tab>
129+
**Content Type:** `application/json`
130+
```json copy=false
131+
"status": 500,
132+
"message": {}
133+
```
134+
</Tab>
135+
</Tabs>
136+
137+
This documentation should help you use [`axios`](https://www.npmjs.com/package/axios) for Node.js and [`requests`](https://pypi.org/project/requests/)
138+
for Python to interact with the `/owoify` endpoint.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"search": "Search"
2+
"generate": "Generate"
33
}
Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,120 @@
1-
owo WIP
1+
import { Tab, Tabs } from "nextra-theme-docs";
2+
3+
# Search
4+
5+
This endpoint allows you to access and retrieve information about your favorite quotes. To access the `/quote` endpoint, you
6+
will need to provide the proper authentication using the Authorization header.
7+
8+
9+
## Endpoint Details
10+
The `/quote` endpoint allows you to retrieve information about a specific quote.
11+
12+
- **URL**: `/quote`
13+
- **Method**: GET
14+
- **Content Type**: application/json
15+
16+
## Authentication
17+
18+
To make requests to the `/quote` endpoint, you must include an `Authorization` header in your API calls. This header should contain a valid access token.
19+
20+
### Example Authorization Header
21+
22+
```jsx
23+
Authorization: YOUR_ACCESS_TOKEN
24+
```
25+
26+
Replace `YOUR_ACCESS_TOKEN` with the actual token provided to you.
27+
28+
## Request Headers
29+
30+
The request to the `/quote` endpoint should be a JSON object with the following headers:
31+
32+
| Header | Type | Description | Required |
33+
| --------------- | ------- | ---------------------------------------------------- | -------- |
34+
| `Authorization` | string | The unique identifier of the user sending the request. | True |
35+
36+
### Example Request
37+
Here's example of how to make a request to the `/quote` endpoint.
38+
39+
<Tabs items={["JavaScript", "Python"]}>
40+
<Tab>
41+
```js
42+
import axios from "axios";
43+
44+
/*
45+
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
46+
*/
47+
const url = "https://quote.it/api/quote";
48+
const data = async () => {
49+
try {
50+
const { data } = await axios.get(url, { headers: {
51+
Authorization: "YOUR_ACCESS_TOKEN",
52+
} });
53+
return data;
54+
} catch (err) {
55+
throw new Error(err.message);
56+
}
57+
};
58+
59+
console.log(data);
60+
```
61+
</Tab>
62+
<Tab>
63+
```python
64+
import requests
65+
66+
"""
67+
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
68+
"""
69+
url = "https://waifu.it/api/quote"
70+
response = requests.get(url, headers={
71+
"Authorization": "YOUR_ACCESS_TOKEN",
72+
})
73+
data = response.json()
74+
75+
print(data)
76+
```
77+
</Tab>
78+
</Tabs>
79+
80+
Remember to replace `YOUR_ACCESS_TOKEN` with your actual access token.
81+
82+
## Responses
83+
84+
The server will respond with an appropriate message based on the input provided. A successfully API request will respond
85+
with a JSON object containing the following information:
86+
87+
- `_id`: The unique identifier of the quote.
88+
- `quote`: This encompasses a collection of quotes and information concerning anime and related subjects.
89+
- `from`: The identification of the anime or related subject from which the quote originated.
90+
- `author`: The attribution of the quote to its source or the person who said it.
91+
- `status`: Response status
92+
93+
<Tabs items={["200 OK", "404 Not Found", "500 Internal Server Error"]}>
94+
<Tab>
95+
**Content Type:** `application/json`
96+
```json copy=false
97+
"_id": 88,
98+
"quote": "I don't know everything. I just know what I know.",
99+
"from": "Nisemonogatari",
100+
"author": "Tsubasa Hanekawa"
101+
```
102+
</Tab>
103+
<Tab>
104+
**Content Type:** `application/json`
105+
```json copy=false
106+
"status": 404,
107+
"message": {}
108+
```
109+
</Tab>
110+
<Tab>
111+
**Content Type:** `application/json`
112+
```json copy=false
113+
"status": 500,
114+
"message": {}
115+
```
116+
</Tab>
117+
</Tabs>
118+
119+
This documentation should help you use [`axios`](https://www.npmjs.com/package/axios) for Node.js and [`requests`](https://pypi.org/project/requests/)
120+
for Python to interact with the `/quote` endpoint.

0 commit comments

Comments
 (0)