Get started
YuuCDN API provides programmatic access to read images data. Retrieve a character, provide an oauth connection, retrieve a familly, filter them, etc.
To use this API, you need an API key.
GET Credentials Token
To get characters you need to make a POST call to the following url :
http://yuucdn.org/api/v1/auth/generate
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
String | (required) The email of the user. | |
password | String | (required) The password of the user. |
RESPONSE
The response will be a JSON object with the following fields:
{
"status": "success",
"message": "Token generated successfully",
"data": {
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6IjYx"
}
}
GET Files
To get characters you need to make a GET call to the following url :
http://yuucdn.org/api/v1/files
HEADERS
Field | Type | Description |
---|---|---|
Authorization | String | (required) The token generated by the GET Credentials Token |
Example:
{
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6IjYx"
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
name | String | (optional) The name of the file. |
folder_id | String | (optional) The id of the folder. |
page | String | (optional) page number. |
limit | String | (optional) number of items per page. |
RESPONSE
The response will be a JSON object with the following fields:
{
"success": true,
"message": "Files retrieved successfully.",
"data": [
{
"id": 18491,
"storage_id": 1,
"user_id": 1,
"name": "android-chrome-192x192.png",
"path": "/images/1/folder-1//android-chrome-192x192.png",
"extension": "png",
"mime_type": "image/png",
"size": 14625,
"preview": null,
"visibility": "public",
"status": "active",
"created_at": "2024-02-04T14:54:06.000000Z",
"updated_at": "2024-02-04T14:54:06.000000Z",
"folder_id": 1,
"url": "https://yuucdn.org//images/1/folder-1/android-chrome-192x192.png",
"folder": {
"id": 1,
"user_id": 1,
"parent_id": null,
"name": "folder 1",
"slug": "ozhGcDOvxf",
"created_at": "2024-02-04T14:51:55.000000Z",
"updated_at": "2024-02-04T14:51:55.000000Z"
},
}
],
"error": {
"error_code": "",
"error_data": []
},
"pagination": {
"total": 1,
"per_page": 50,
"current_page": 1,
"last_page": 1,
"first_page_url": "https://yuucdn.org/api/v1/files?page=1",
"last_page_url": "https://yuucdn.org/api/v1/files?page=1",
"next_page_url": null,
"prev_page_url": null,
"from": 1,
"to": 1
}
}
GET Folders
To get characters you need to make a GET call to the following url :
http://yuucdn.org/api/v1/folders
HEADERS
Field | Type | Description |
---|---|---|
Authorization | String | (required) The token generated by the GET Credentials Token |
Example:
{
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6IjYx"
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
name | String | (optional) The name of the file. |
parent_id | String | (optional) The id of the folder. |
page | String | (optional) page number. |
limit | String | (optional) number of items per page. |
RESPONSE
The response will be a JSON object with the following fields:
{
"success": true,
"message": "Folders retrieved successfully.",
"data": [
{
"id": 1,
"user_id": 1,
"parent_id": null,
"name": "folder 1",
"slug": "ozhGcDOvxf",
"created_at": "2024-02-04T14:51:55.000000Z",
"updated_at": "2024-02-04T14:51:55.000000Z"
},
],
"error": {
"error_code": "",
"error_data": []
},
"pagination": {
"total": 12,
"per_page": 50,
"current_page": 1,
"last_page": 1,
"first_page_url": "https://yuucdn.org/api/v1/folders?page=1",
"last_page_url": "https://yuucdn.org/api/v1/folders?page=1",
"next_page_url": null,
"prev_page_url": null,
"from": 1,
"to": 12
}
}
Create Folders
To get characters you need to make a POST call to the following url :
http://yuucdn.org/api/v1/folders
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
name | String | (required) Name of folder you will be created. |
parent_id | Number | (optional) ID Folder exists on your folder has been created. |
RESPONSE
The response will be a JSON object with the following fields:
{
"status": "success",
"message": "Token generated successfully",
"data": {
"name": "Nama Folder Coba",
"slug": "GN95VlSWf5",
"user_id": 1,
"parent_id": null,
"updated_at": "2024-06-12T12:58:03.000000Z",
"created_at": "2024-06-12T12:58:03.000000Z",
"id": 22741
}
}
Upload Files
To get characters you need to make a POST call to the following url :
http://yuucdn.org/api/v1/upload
HEADERS
Field | Type | Description |
---|---|---|
Authorization | String | (required) The token generated by the GET Credentials Token |
Example:
{
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6IjYx"
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
file | File (binary) | (required) The file to upload. |
folder_id | String | (optional) The id of the folder. |
RESPONSE
The response will be a JSON object with the following fields:
{
"success": true,
"message": "File uploaded successfully",
"data": {
"storage_id": 1,
"user_id": 1,
"folder_id": null,
"name": "2727521-22-(1)-(2).jpg",
"path": "images/1/2727521-22-(1)-(2).jpg",
"extension": "jpg",
"mime_type": "application/octet-stream",
"size": 485150,
"visibility": "public",
"updated_at": "2024-02-07T09:12:27.000000Z",
"created_at": "2024-02-07T09:12:27.000000Z",
"id": 1003226,
"url": "https://yuucdn.org/images/1/2727521-22-(1)-(2).jpg"
},
"error": {
"error_code": "",
"error_data": []
},
"pagination": []
}
Upload URL
To get characters you need to make a POST call to the following url :
http://yuucdn.org/api/v1/upload/url
HEADERS
Field | Type | Description |
---|---|---|
Authorization | String | (required) The token generated by the GET Credentials Token |
Example:
{
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6IjYx"
}
QUERY PARAMETERS
Field | Type | Description |
---|---|---|
url | String | (required) The url of the file to upload. |
folder_id | String | (optional) The id of the folder. |
RESPONSE
The response will be a JSON object with the following fields:
{
"success": true,
"message": "File uploaded successfully",
"data": {
"storage_id": 1,
"user_id": 1,
"folder_id": null,
"name": "2727521-22-(1)-(2).jpg",
"path": "images/1/2727521-22-(1)-(2).jpg",
"extension": "jpg",
"mime_type": "application/octet-stream",
"size": 485150,
"visibility": "public",
"updated_at": "2024-02-07T09:12:27.000000Z",
"created_at": "2024-02-07T09:12:27.000000Z",
"id": 1003226,
"url": "https://yuucdn.org/images/1/2727521-22-(1)-(2).jpg"
},
"error": {
"error_code": "",
"error_data": []
},
"pagination": []
}
Errors
The Westeros API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Some parameters are missing. This error appears when you don't pass every mandatory parameters. |
401 |
Unknown or unvalid Authorization . This error appears if
you
use an unknow API key or if your API key expired.
|
404 | The requested resource doesn't exist. This error appears when you try to access to a resource that doesn't exist. |
422 | The request is well formed but the server was unable to process it. This error appears when you try to access to a resource that doesn't exist. |
500 | The server has encountered a situation it doesn't know how to handle. This error appears when the server has an internal error. |