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