Skip to content
Merged
Prev Previous commit
Next Next commit
Added documentation for the endpoints
  • Loading branch information
a3ryk committed Jul 22, 2023
commit 68100d4109db0ee0270ae8849bdb51b5bae1e6b7
2 changes: 1 addition & 1 deletion pages/libraries/Python/waifuit/search.mdx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
owo WIP
The developer hasn't provided documentation yet. Reach them at -> [Discord](https://discord.gg/yyW389c)
118 changes: 117 additions & 1 deletion pages/rest-api/Texts/Fact/search.mdx
Original file line number Diff line number Diff line change
@@ -1 +1,117 @@
owo WIP
import { Tab, Tabs } from "nextra-theme-docs";

# Search

This endpoint allows you to access and retrieve information about your favorite facts. To access the `/fact` endpoint, you
will need to provide the proper authentication using the Authorization header.


## Endpoint Details
The `/fact` endpoint allows you to retrieve information about a specific fact.

- **URL**: `/fact`
- **Method**: GET
- **Content Type**: application/json

## Authentication

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.

### Example Authorization Header

```jsx
Authorization: YOUR_ACCESS_TOKEN
```

Replace `YOUR_ACCESS_TOKEN` with the actual token provided to you.

## Request Headers

The request to the `/fact` endpoint should be a JSON object with the following headers:

| Header | Type | Description | Required |
| --------------- | ------- | ---------------------------------------------------- | -------- |
| `Authorization` | string | The unique identifier of the user sending the request. | True |

### Example Request
Here's example of how to make a request to the `/fact` endpoint.

<Tabs items={["JavaScript", "Python"]}>
<Tab>
```js
import axios from "axios";

/*
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
*/
const url = "https://fact.it/api/fact";
const data = async () => {
try {
const { data } = await axios.get(url, { headers: {
Authorization: "YOUR_ACCESS_TOKEN",
} });
return data;
} catch (err) {
throw new Error(err.message);
}
};

console.log(data);
```
</Tab>
<Tab>
```python
import requests

"""
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
"""
url = "https://waifu.it/api/fact"
response = requests.get(url, headers={
"Authorization": "YOUR_ACCESS_TOKEN",
})
data = response.json()

print(data)
```
</Tab>
</Tabs>

Remember to replace `YOUR_ACCESS_TOKEN` with your actual access token.

## Responses

The server will respond with an appropriate message based on the input provided. A successfully API request will respond
with a JSON object containing the following information:

- `_id`: The unique identifier of the fact.
- `fact`: This pertains to various facts and information related to anime and related topics.
- `status`: Response status

<Tabs items={["200 OK", "404 Not Found", "500 Internal Server Error"]}>
<Tab>
**Content Type:** `application/json`
```json copy=false
"_id": 48,
"fact": "TEZUKA Osamu is the most famous manga artist in Japan."
"status": 200,
```
</Tab>
<Tab>
**Content Type:** `application/json`
```json copy=false
"status": 404,
"message": {}
```
</Tab>
<Tab>
**Content Type:** `application/json`
```json copy=false
"status": 500,
"message": {}
```
</Tab>
</Tabs>

This documentation should help you use [`axios`](https://www.npmjs.com/package/axios) for Node.js and [`requests`](https://pypi.org/project/requests/)
for Python to interact with the `/fact` endpoint.
138 changes: 138 additions & 0 deletions pages/rest-api/Texts/Owoify/generate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import { Tab, Tabs } from "nextra-theme-docs";

# Search

This endpoint allows you to generate owoified text. To access the `/owoify` endpoint, you
will need to provide the proper authentication using the Authorization header.


## Endpoint Details
The `/owoify` endpoint allows you to retrieve information about a specific owoify.

- **URL**: `/owoify`
- **Method**: GET
- **Content Type**: application/json

## Authentication

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.

### Example Authorization Header

```jsx
Authorization: YOUR_ACCESS_TOKEN
```

Replace `YOUR_ACCESS_TOKEN` with the actual token provided to you.

## Request
### Headers

The request to the `/owoify` endpoint should be a JSON object with the following headers:

| Header | Type | Description | Required |
| --------------- | ------- | ---------------------------------------------------- | -------- |
| `Authorization` | string | The unique identifier of the user sending the request. | True |

### Parameters

These are the request parameters for the `/owoify` endpoint.

| Parameter | Type | Description | Required |
| --------- | ------ | ------------------------------------------------------------------ | -------- |
| `text` | string | The text you want to convert into an "owo" language-style format. | True |

## Example Request
Here's an example of how to make a request to the `/owoify` endpoint.

<Tabs items={["JavaScript", "Python"]}>
<Tab>
```js
import axios from "axios";

/*
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
*/
const url = "https://waifu.it/api/owoify";
const text = "Hello world"; // Replace with your desired owoify length (optional).
const data = async () => {
try {
const { data } = await axios.get(url, {
headers: {
Authorization: "YOUR_ACCESS_TOKEN",
},
params: {
text: text || undefined,
}
});
return data;
} catch (err) {
throw new Error(err.message);
}
};

console.log(data);
```
</Tab>
<Tab>
```python
import requests

"""
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
"""
url = "https://waifu.it/api/owoify"

text = "Hello world" # Replace with your desired owoify length (optional).

params = {
"text": text if text is not None else None,
}

response = requests.get(url, headers={
"Authorization": "YOUR_ACCESS_TOKEN",
}, params=params)

data = response.json()

print(data)
```
</Tab>
</Tabs>

Remember to replace `YOUR_ACCESS_TOKEN` with your actual access token.

## Responses

The server will respond with an appropriate message based on the input provided. A successfully API request will respond
with a JSON object containing the following information:

- `owoify`: The owoified that is generated for you.
- `status`: Response status

<Tabs items={["200 OK", "404 Not Found", "500 Internal Server Error"]}>
<Tab>
**Content Type:** `application/json`
```json copy=false
"text": "Hewwo wowwd"
"status": 200,
```
</Tab>
<Tab>
**Content Type:** `application/json`
```json copy=false
"status": 404,
"message": {}
```
</Tab>
<Tab>
**Content Type:** `application/json`
```json copy=false
"status": 500,
"message": {}
```
</Tab>
</Tabs>

This documentation should help you use [`axios`](https://www.npmjs.com/package/axios) for Node.js and [`requests`](https://pypi.org/project/requests/)
for Python to interact with the `/owoify` endpoint.
2 changes: 1 addition & 1 deletion pages/rest-api/Texts/Password/_meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"search": "Search"
"generate": "Generate"
}
121 changes: 120 additions & 1 deletion pages/rest-api/Texts/Quote/search.mdx
Original file line number Diff line number Diff line change
@@ -1 +1,120 @@
owo WIP
import { Tab, Tabs } from "nextra-theme-docs";

# Search

This endpoint allows you to access and retrieve information about your favorite quotes. To access the `/quote` endpoint, you
will need to provide the proper authentication using the Authorization header.


## Endpoint Details
The `/quote` endpoint allows you to retrieve information about a specific quote.

- **URL**: `/quote`
- **Method**: GET
- **Content Type**: application/json

## Authentication

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.

### Example Authorization Header

```jsx
Authorization: YOUR_ACCESS_TOKEN
```

Replace `YOUR_ACCESS_TOKEN` with the actual token provided to you.

## Request Headers

The request to the `/quote` endpoint should be a JSON object with the following headers:

| Header | Type | Description | Required |
| --------------- | ------- | ---------------------------------------------------- | -------- |
| `Authorization` | string | The unique identifier of the user sending the request. | True |

### Example Request
Here's example of how to make a request to the `/quote` endpoint.

<Tabs items={["JavaScript", "Python"]}>
<Tab>
```js
import axios from "axios";

/*
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
*/
const url = "https://quote.it/api/quote";
const data = async () => {
try {
const { data } = await axios.get(url, { headers: {
Authorization: "YOUR_ACCESS_TOKEN",
} });
return data;
} catch (err) {
throw new Error(err.message);
}
};

console.log(data);
```
</Tab>
<Tab>
```python
import requests

"""
Replace "YOUR_ACCESS_TOKEN" with the token you got from the Kohai Bot and the endpoint.
"""
url = "https://waifu.it/api/quote"
response = requests.get(url, headers={
"Authorization": "YOUR_ACCESS_TOKEN",
})
data = response.json()

print(data)
```
</Tab>
</Tabs>

Remember to replace `YOUR_ACCESS_TOKEN` with your actual access token.

## Responses

The server will respond with an appropriate message based on the input provided. A successfully API request will respond
with a JSON object containing the following information:

- `_id`: The unique identifier of the quote.
- `quote`: This encompasses a collection of quotes and information concerning anime and related subjects.
- `from`: The identification of the anime or related subject from which the quote originated.
- `author`: The attribution of the quote to its source or the person who said it.
- `status`: Response status

<Tabs items={["200 OK", "404 Not Found", "500 Internal Server Error"]}>
<Tab>
**Content Type:** `application/json`
```json copy=false
"_id": 88,
"quote": "I don't know everything. I just know what I know.",
"from": "Nisemonogatari",
"author": "Tsubasa Hanekawa"
```
</Tab>
<Tab>
**Content Type:** `application/json`
```json copy=false
"status": 404,
"message": {}
```
</Tab>
<Tab>
**Content Type:** `application/json`
```json copy=false
"status": 500,
"message": {}
```
</Tab>
</Tabs>

This documentation should help you use [`axios`](https://www.npmjs.com/package/axios) for Node.js and [`requests`](https://pypi.org/project/requests/)
for Python to interact with the `/quote` endpoint.