SHOW:
|
|
- or go back to the newest paste.
| 1 | Rate Limits: | |
| 2 | Not more than 20 requests in 10 seconds, else restricted for 1 minute | |
| 3 | ||
| 4 | API Key: | |
| 5 | xx | |
| 6 | ||
| 7 | - | API Scopes: |
| 7 | + | |
| 8 | - | locked_spoiler_access |
| 8 | + | |
| 9 | - | locked_encrypt_spoiler_access |
| 9 | + | 403 (invalid API key) |
| 10 | - | can_unlock_spoiler |
| 10 | + | |
| 11 | - | can_unlock_encrypt_spoiler |
| 11 | + | |
| 12 | - | can_create_encrypt |
| 12 | + | |
| 13 | Endpoints (https://ootrandomizer.com): | |
| 14 | ||
| 15 | *Create Seed* | |
| 16 | - | 403 (invalid API key or insufficient API scope) |
| 16 | + | |
| 17 | URL: "/api/sglive/seed/create" | |
| 18 | Method: POST | |
| 19 | Required query parameters: key (API key) | |
| 20 | Optional query parameters: version (SemVer format, e.g. 5.2.0), encrypt (has to be explicitly set to true for it to apply ; creates an encrypted race seed if present ; spoiler log is automatically force hidden), locked (if present spoiler log will always be hidden by default, otherwise shown, unless encrypted) | |
| 21 | Body: JSON settings map (a seed field can be included to force a specific seed string, otherwise random) | |
| 22 | ||
| 23 | Response: | |
| 24 | - | URL: "/api/v2/seed/create" |
| 24 | + | |
| 25 | Return data type if success (seed queried): application/json | |
| 26 | Return data fields: | |
| 27 | - | Optional query parameters: version (SemVer format, e.g. 5.2.0 for release or dev_x.x.x for dev), locked (if present spoiler log will be hidden by default, otherwise shown), encrypt (creates an encrypted seed, requires "can_create_encrypt" scope) |
| 27 | + | |
| 28 | - | Optional API scope: can_create_encrypt |
| 28 | + | |
| 29 | -spoilers (true if a spoiler log will be generated and shown to the user by default, false otherwise) | |
| 30 | ||
| 31 | ||
| 32 | *Get Seed Status* | |
| 33 | Request: | |
| 34 | URL: "/api/sglive/seed/status" | |
| 35 | Method: GET | |
| 36 | Required query parameters: key (API key), id (seed ID) | |
| 37 | ||
| 38 | Response: | |
| 39 | Possible error codes: 404 (seed not found/expired) | |
| 40 | Return data type if success: application/json | |
| 41 | Return data fields: | |
| 42 | - | URL: "/api/v2/seed/status" |
| 42 | + | |
| 43 | -progress (generation progress, 100 if finished with success or error) | |
| 44 | Optional return data fields: | |
| 45 | -version (randomizer version in-use ; only present if status = 0) | |
| 46 | -positionQueue (position in queue, 0 if currently processing ; only present if status = 0) | |
| 47 | -maxWaitTime (ETA in seconds, 0 if currently processing ; only present if status = 0) | |
| 48 | -isMultiWorld (only present if status = 0) | |
| 49 | ||
| 50 | ||
| 51 | *Get Seed Details* | |
| 52 | Request: | |
| 53 | URL: "/api/sglive/seed/details" | |
| 54 | Method: GET | |
| 55 | Required query parameters: key (API key), id (seed ID) | |
| 56 | ||
| 57 | Response: | |
| 58 | Possible error codes: 404 (seed not found/expired/errored), 204 (still generating) | |
| 59 | Return data type if success: application/json | |
| 60 | Return data fields: | |
| 61 | - | URL: "/api/v2/seed/details" |
| 61 | + | |
| 62 | -seed (seed string) | |
| 63 | -settingsString | |
| 64 | - | Optional API scope: locked_spoiler_access, locked_encrypt_spoiler_access |
| 64 | + | |
| 65 | ||
| 66 | ||
| 67 | *Get Seed Patch File* | |
| 68 | Request: | |
| 69 | URL: "/api/sglive/seed/patch" | |
| 70 | Method: GET | |
| 71 | Required query parameters: key (API key), id (seed ID) | |
| 72 | ||
| 73 | - | -settingsLog (full JSON settings log, null if none was generated which is only possible on very old versions) |
| 73 | + | |
| 74 | - | -spoilerLog (full JSON spoiler log, null if none was generated or when insufficient API privileges to read a hidden log ; with correct API scope this data is present even if the log was hidden from users) |
| 74 | + | |
| 75 | Return data type if success: application/octet-stream | |
| 76 | Return data: raw patch file |