Blame
|
1 | # Thumbnails |
||||||
| 2 | ||||||||
| 3 | An [[API Key|YiffyAPI/APIKey]] <span style="color: red;">is</span> required for this service. See [[Shared Responses|YiffyAPI/Shared Responses]] for common error responses. |
|||||||
| 4 | ||||||||
| 5 | ## Get Thumbnail Information |
|||||||
| 6 | > <code><span style="color: rgb(52, 141, 248);">GET</span></code> `https://thumbs.yiff.rest/{id}` |
|||||||
| 7 | ||||||||
| 8 | ::: none |
|||||||
| 9 | # Path Parameters |
|||||||
| 10 | | Name | Type | Description | |
|||||||
| 11 | | ----------------------------------------------------- | ------ | ------------------------------ | |
|||||||
| 12 | | id <span style="color: red" title="required">*</span> | String | The MD5 or ID of an e621 post. | |
|||||||
| 13 | ::: |
|||||||
| 14 | ||||||||
| 15 | ::: success |
|||||||
| 16 | # 200 OK: Success |
|||||||
| 17 | ```json |
|||||||
| 18 | { |
|||||||
| 19 | "success": true, |
|||||||
| 20 | "post_id": 5220880, |
|||||||
|
21 | // all nullable |
||||||
| 22 | "png": "https://thumbs.yiff.media/922a7bfc2a0a19cb789cbb62c80ccba9.png", |
|||||||
| 23 | "jpg": "https://thumbs.yiff.media/922a7bfc2a0a19cb789cbb62c80ccba9.jpg", |
|||||||
| 24 | "gif": "https://thumbs.yiff.media/922a7bfc2a0a19cb789cbb62c80ccba9.gif", |
|||||||
| 25 | "webp": "https://thumbs.yiff.media/922a7bfc2a0a19cb789cbb62c80ccba9.webp" |
|||||||
|
26 | } |
||||||
| 27 | ``` |
|||||||
| 28 | ::: |
|||||||
| 29 | ||||||||
| 30 | ::: danger |
|||||||
| 31 | # 400 Bad Request: Deleted Post |
|||||||
| 32 | ```json |
|||||||
| 33 | { |
|||||||
| 34 | "success": false, |
|||||||
| 35 | "code": 1068, |
|||||||
| 36 | "error": "Post is deleted" |
|||||||
| 37 | } |
|||||||
| 38 | ``` |
|||||||
| 39 | ::: |
|||||||
| 40 | ||||||||
| 41 | ::: danger |
|||||||
| 42 | # 404 Not Found: Invalid ID |
|||||||
| 43 | ```json |
|||||||
| 44 | { |
|||||||
| 45 | "success": false, |
|||||||
| 46 | "code": 1062, |
|||||||
| 47 | "error": "Invalid Post: Not found (ID)" |
|||||||
| 48 | } |
|||||||
| 49 | ``` |
|||||||
| 50 | ::: |
|||||||
| 51 | ||||||||
| 52 | ::: danger |
|||||||
| 53 | # 404 Not Found: Invalid MD5 |
|||||||
| 54 | ```json |
|||||||
| 55 | { |
|||||||
| 56 | "success": false, |
|||||||
| 57 | "code": 1062, |
|||||||
| 58 | "error": "Invalid Post: Not found (MD5)" |
|||||||
| 59 | } |
|||||||
| 60 | ``` |
|||||||
| 61 | ::: |
|||||||
| 62 | ||||||||
| 63 | <hr> |
|||||||
| 64 | ||||||||
| 65 | ## Create Thumbnail |
|||||||
| 66 | > <code><span style="color: rgb(254, 85, 27);">PUT</span></code> `https://thumbs.yiff.rest/{id}/{type}` |
|||||||
| 67 | <p>A 202 Accepted will be returned in most circumstances. This is a non committal answer. You must fetch `checkURL` at the specified `checkAt` time. (you will be given a new check time if it's still processing)</p> |
|||||||
| 68 | <p>If generation has already been started by someone else, a 202 Accepted will still be returned.</p> |
|||||||
| 69 | <p>If a thumbnail has already been created, a 200 OK will be returned.</p> |
|||||||
| 70 | ||||||||
| 71 | ::: none |
|||||||
| 72 | # Path Parameters |
|||||||
| 73 | | Name | Type | Description | |
|||||||
| 74 | | ------------------------------------------------------- | ------ | ------------------------------ | |
|||||||
| 75 | | id <span style="color: red" title="required">*</span> | String | The MD5 or ID of an e621 post. | |
|||||||
|
76 | | type <span style="color: red" title="required">*</span> | String | `png`, `jpg`, `gif`, `webp` | |
||||||
|
77 | ::: |
||||||
| 78 | ||||||||
| 79 | ::: success |
|||||||
| 80 | # 200 OK: Generation Complete |
|||||||
| 81 | ```json |
|||||||
| 82 | { |
|||||||
| 83 | "success": true, |
|||||||
| 84 | "status": "done", |
|||||||
| 85 | "post_id": 5220880, |
|||||||
| 86 | "url": "https://thumbs.yiff.media/922a7bfc2a0a19cb789cbb62c80ccba9.png" |
|||||||
| 87 | } |
|||||||
| 88 | ``` |
|||||||
| 89 | ::: |
|||||||
| 90 | ||||||||
| 91 | ::: success |
|||||||
| 92 | # 202 Accepted: Generation In Progress |
|||||||
| 93 | ```json |
|||||||
| 94 | { |
|||||||
| 95 | "success": true, |
|||||||
| 96 | "status": "processing", |
|||||||
| 97 | "post_id": 5220880, |
|||||||
| 98 | "checkURL": "https://thumbs.yiff.rest/check/922a7bfc2a0a19cb789cbb62c80ccba9/png", |
|||||||
| 99 | "checkAt": 0, // (unix millis) the time at which you should fetch the above url |
|||||||
| 100 | "time": 0, // the milliseconds after which you should check the above url (see checkAt) |
|||||||
| 101 | "startedAt": 0 // (unix millis) the time at which processing started |
|||||||
| 102 | } |
|||||||
| 103 | ``` |
|||||||
| 104 | ::: |
|||||||
| 105 | ||||||||
| 106 | ::: danger |
|||||||
| 107 | # 400 Bad Request: Deleted Post |
|||||||
| 108 | ```json |
|||||||
| 109 | { |
|||||||
| 110 | "success": false, |
|||||||
| 111 | "code": 1068, |
|||||||
| 112 | "error": "Post is deleted" |
|||||||
| 113 | } |
|||||||
| 114 | ``` |
|||||||
| 115 | ::: |
|||||||
| 116 | ||||||||
| 117 | ::: danger |
|||||||
|
118 | # 400 Bad Request: Animated Types Disabled |
||||||
| 119 | During times of high load or low storage, the animated types may be prevented from being generated. |
|||||||
|
120 | ```json |
||||||
| 121 | { |
|||||||
| 122 | "success": false, |
|||||||
| 123 | "code": 1067, |
|||||||
|
124 | "error": "The animated types have been disabled." |
||||||
|
125 | } |
||||||
| 126 | ``` |
|||||||
| 127 | ::: |
|||||||
| 128 | ||||||||
| 129 | ::: danger |
|||||||
| 130 | # 404 Not Found: Invalid Type |
|||||||
| 131 | ```json |
|||||||
| 132 | { |
|||||||
| 133 | "success": false, |
|||||||
| 134 | "code": 1062, |
|||||||
| 135 | "error": "Invalid Type: invalid" |
|||||||
| 136 | } |
|||||||
| 137 | ``` |
|||||||
| 138 | ::: |
|||||||
| 139 | ||||||||
| 140 | ::: danger |
|||||||
| 141 | # 404 Not Found: Invalid ID |
|||||||
| 142 | ```json |
|||||||
| 143 | { |
|||||||
| 144 | "success": false, |
|||||||
| 145 | "code": 1062, |
|||||||
| 146 | "error": "Invalid Post: Not found (ID)" |
|||||||
| 147 | } |
|||||||
| 148 | ``` |
|||||||
| 149 | ::: |
|||||||
| 150 | ||||||||
| 151 | ::: danger |
|||||||
| 152 | # 404 Not Found: Invalid MD5 |
|||||||
| 153 | ```json |
|||||||
| 154 | { |
|||||||
| 155 | "success": false, |
|||||||
| 156 | "code": 1062, |
|||||||
| 157 | "error": "Invalid Post: Not found (MD5)" |
|||||||
| 158 | } |
|||||||
| 159 | ``` |
|||||||
| 160 | ::: |
|||||||
| 161 | ||||||||
| 162 | ::: danger |
|||||||
| 163 | # 500 Internal Server Error: Generation Timeout |
|||||||
| 164 | ```json |
|||||||
| 165 | { |
|||||||
| 166 | "success": false, |
|||||||
| 167 | "code": 1065, |
|||||||
| 168 | "error": "Generation timed out.", |
|||||||
| 169 | "expiresAt": 0 // (unix millis) when the failed generation expires (retrying is possible after expiry), also nullable |
|||||||
| 170 | } |
|||||||
| 171 | ``` |
|||||||
| 172 | ::: |
|||||||
| 173 | ||||||||
| 174 | ::: danger |
|||||||
| 175 | # 500 Internal Server Error: Generation Error |
|||||||
| 176 | ```json |
|||||||
| 177 | { |
|||||||
| 178 | "success": false, |
|||||||
| 179 | "code": 1060, |
|||||||
| 180 | "error": "Generation encountered an error.", |
|||||||
| 181 | "expiresAt": 0 // (unix millis) when the failed generation expires (retrying is possible after expiry), also nullable |
|||||||
| 182 | } |
|||||||
| 183 | ``` |
|||||||
| 184 | ::: |
|||||||
| 185 | ||||||||
| 186 | <hr> |
|||||||
| 187 | ||||||||
| 188 | ## Check Generation Progress |
|||||||
| 189 | > <code><span style="color: rgb(52, 141, 248);">GET</span></code> `https://thumbs.yiff.rest/check/{id}/{type}` |
|||||||
| 190 | ||||||||
| 191 | ::: none |
|||||||
| 192 | # Path Parameters |
|||||||
| 193 | | Name | Type | Description | |
|||||||
| 194 | | ------------------------------------------------------- | ------ | ------------------------------ | |
|||||||
| 195 | | id <span style="color: red" title="required">*</span> | String | The MD5 or ID of an e621 post. | |
|||||||
|
196 | | type <span style="color: red" title="required">*</span> | String | `png`, `jpg`, `gif`, `webp` | |
||||||
|
197 | ::: |
||||||
| 198 | ||||||||
| 199 | ::: success |
|||||||
| 200 | # 200 OK: Generation In Progress |
|||||||
| 201 | ```json |
|||||||
| 202 | { |
|||||||
| 203 | "success": true, |
|||||||
| 204 | "status": "processing", |
|||||||
| 205 | "post_id": 5220880, |
|||||||
| 206 | "checkURL": "https://thumbs.yiff.rest/check/922a7bfc2a0a19cb789cbb62c80ccba9/png", |
|||||||
| 207 | "checkAt": 0, // (unix millis) the time at which you should fetch the above url |
|||||||
| 208 | "time": 0, // the milliseconds after which you should check the above url (see checkAt) |
|||||||
| 209 | "startedAt": 0 // (unix millis) the time at which processing started |
|||||||
| 210 | } |
|||||||
| 211 | ``` |
|||||||
| 212 | ::: |
|||||||
| 213 | ||||||||
| 214 | ::: success |
|||||||
| 215 | # 201 Created: Generation Complete |
|||||||
| 216 | ```json |
|||||||
| 217 | { |
|||||||
| 218 | "success": true, |
|||||||
| 219 | "status": "done", |
|||||||
| 220 | "post_id": 5220880, |
|||||||
| 221 | "url": "https://thumbs.yiff.media/922a7bfc2a0a19cb789cbb62c80ccba9.png" |
|||||||
| 222 | } |
|||||||
| 223 | ``` |
|||||||
| 224 | ::: |
|||||||
| 225 | ||||||||
| 226 | ::: danger |
|||||||
| 227 | # 400 Bad Request: Deleted Post |
|||||||
| 228 | ```json |
|||||||
| 229 | { |
|||||||
| 230 | "success": false, |
|||||||
| 231 | "code": 1068, |
|||||||
| 232 | "error": "Post is deleted" |
|||||||
| 233 | } |
|||||||
| 234 | ``` |
|||||||
| 235 | ::: |
|||||||
| 236 | ||||||||
| 237 | ::: danger |
|||||||
|
238 | # 400 Bad Request: Animated Types Disabled |
||||||
| 239 | During times of high load or low storage, the animated types may be prevented from being generated. |
|||||||
|
240 | ```json |
||||||
| 241 | { |
|||||||
| 242 | "success": false, |
|||||||
| 243 | "code": 1067, |
|||||||
|
244 | "error": "The animated types have been disabled." |
||||||
|
245 | } |
||||||
| 246 | ``` |
|||||||
| 247 | ::: |
|||||||
| 248 | ||||||||
| 249 | ::: danger |
|||||||
| 250 | # 404 Not Found: Invalid Type |
|||||||
| 251 | ```json |
|||||||
| 252 | { |
|||||||
| 253 | "success": false, |
|||||||
| 254 | "code": 1062, |
|||||||
| 255 | "error": "Invalid Type: invalid" |
|||||||
| 256 | } |
|||||||
| 257 | ``` |
|||||||
| 258 | ::: |
|||||||
| 259 | ||||||||
| 260 | ::: danger |
|||||||
| 261 | # 404 Not Found: Invalid ID |
|||||||
| 262 | ```json |
|||||||
| 263 | { |
|||||||
| 264 | "success": false, |
|||||||
| 265 | "code": 1062, |
|||||||
| 266 | "error": "Invalid Post: Not found (ID)" |
|||||||
| 267 | } |
|||||||
| 268 | ``` |
|||||||
| 269 | ::: |
|||||||
| 270 | ||||||||
| 271 | ::: danger |
|||||||
| 272 | # 404 Not Found: Invalid MD5 |
|||||||
| 273 | ```json |
|||||||
| 274 | { |
|||||||
| 275 | "success": false, |
|||||||
| 276 | "code": 1062, |
|||||||
| 277 | "error": "Invalid Post: Not found (MD5)" |
|||||||
| 278 | } |
|||||||
| 279 | ``` |
|||||||
| 280 | ::: |
|||||||
| 281 | ||||||||
| 282 | ::: danger |
|||||||
| 283 | # 404 Not Found: Check Not Found |
|||||||
| 284 | ```json |
|||||||
| 285 | { |
|||||||
| 286 | "success": false, |
|||||||
| 287 | "code": 1066, |
|||||||
| 288 | "error": "Not Found" |
|||||||
| 289 | } |
|||||||
| 290 | ``` |
|||||||
| 291 | ::: |
|||||||
| 292 | ||||||||
| 293 | ::: danger |
|||||||
| 294 | # 500 Internal Server Error: Generation Timeout |
|||||||
| 295 | ```json |
|||||||
| 296 | { |
|||||||
| 297 | "success": false, |
|||||||
| 298 | "code": 1065, |
|||||||
| 299 | "error": "Generation timed out.", |
|||||||
| 300 | "expiresAt": 0 // (unix millis) when the failed generation expires (retrying is possible after expiry), also nullable |
|||||||
| 301 | } |
|||||||
| 302 | ``` |
|||||||
| 303 | ::: |
|||||||
| 304 | ||||||||
| 305 | ::: danger |
|||||||
| 306 | # 500 Internal Server Error: Generation Error |
|||||||
| 307 | ```json |
|||||||
| 308 | { |
|||||||
| 309 | "success": false, |
|||||||
| 310 | "code": 1060, |
|||||||
| 311 | "error": "Generation encountered an error.", |
|||||||
| 312 | "expiresAt": 0 // (unix millis) when the failed generation expires (retrying is possible after expiry), also nullable |
|||||||
| 313 | } |
|||||||
| 314 | ``` |
|||||||
| 315 | ::: |
|||||||
