|
| 1 | +import { Tab, Tabs } from "nextra-theme-docs"; |
| 2 | + |
| 3 | +# Search |
| 4 | + |
| 5 | +This endpoint allows you to generate uwuified text. To access the `/uwuify` endpoint, you |
| 6 | +will need to provide the proper authentication using the Authorization header. |
| 7 | + |
| 8 | + |
| 9 | +## Endpoint Details |
| 10 | +The `/uwuify` endpoint allows you to retrieve information about a specific uwuify. |
| 11 | + |
| 12 | +- **URL**: `/uwuify` |
| 13 | +- **Method**: GET |
| 14 | +- **Content Type**: application/json |
| 15 | + |
| 16 | +## Authentication |
| 17 | + |
| 18 | +To make requests to the `/uwuify` 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 `/uwuify` 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 `/uwuify` endpoint. |
| 40 | + |
| 41 | +| Parameter | Type | Description | Required | |
| 42 | +| --------- | ------ | ------------------------------------------------------------------ | -------- | |
| 43 | +| `text` | string | The text you want to convert into an "uwu" language-style format. | True | |
| 44 | + |
| 45 | +## Example Request |
| 46 | +Here's an example of how to make a request to the `/uwuify` 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/uwuify"; |
| 57 | + const text = "Hello world"; // Replace with your desired uwuify 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/uwuify" |
| 85 | + |
| 86 | + text = "Hello world" # Replace with your desired uwuify 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 | +- `uwuify`: The uwuified 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 `/uwuify` endpoint. |
0 commit comments