====== API ====== \\ The FF6WC API allows developers to generate seeds, query seed/flag information, and download patch/log files. Access requires an API key and an account on [[https://ff6wc.com|ff6wc.com]] to link with. API keys should be kept private and may be requested from AtmaTek on [[Discord|Discord]]. ===== Generate Seed ===== ---- **Description** Generate a new seed with a given flag string **Endpoint** %%https://www.ff6wc.com/api/generate%% **Method** POST **Arguments** { "key" : "", "flags" : "", } An optional description string may also be provided: { "key" : "", "flags" : "", "description" : "", } **Returns** { "id" : "", "flags_id" : "", "version" : "", "hash" : "" "url" : "", } **Errors** ^ Error Code ^ Reason ^ | 400 | Invalid JSON request or missing required argument | | 401 | Invalid or inactive API Key | | 429 | Rate limit exceeded (20/minute, 120/hour, 500/day) | | 500 | Failed to generate seed or calculate limits | **Examples** $ curl -X POST -d '{"key" : "", "flags" : "-cg -sl"}' https://www.ff6wc.com/api/generate {"flags_id":"Wtq78b6JWjly","hash":"Banon, Vargas, Narshe Guard, Fish","id":"24zKw0Vldap6","url":"https://www.ff6wc.com/seed/24zKw0Vldap6","version":"1.0.3"} $ curl -X POST -d '{"key" : "", "flags" : "-s myseed -cg -sl", "description" : "test description"}' https://www.ff6wc.com/api/generate {"flags_id":"Wtq78b6JWjly","hash":"Banon, Vargas, Narshe Guard, Fish","id":"QoMGQuoS5Dha","url":"https://www.ff6wc.com/seed/QoMGQuoS5Dha","version":"1.0.3"} $ curl -X POST -d '{"key" : ""}' https://www.ff6wc.com/api/generate {"error":"'flags' required"} ===== Seed Info ===== ---- **Description** Query information about a given seed **Endpoint** %%https://www.ff6wc.com/api/seed//%% **Method** GET **Returns** { "id" : "", "version" : "" "flags_id" : "", "hash" : "", "description" : "", "url" : "", "created_at" : " **Errors** ^ Error Code ^ Reason ^ | 401 | Invalid or inactive API Key | | 404 | Invalid seed ID | **Examples** $ curl -X GET https://www.ff6wc.com/api/seed//24zKw0Vldap6 {"created_at":"Tue, 25 Jan 2022 09:50:49 GMT","created_by":"TestBot","description":"","flags_id":"Wtq78b6JWjly","hash":"Banon, Vargas, Narshe Guard, Fish","id":"24zKw0Vldap6","url":"https://www.ff6wc.com/seed/24zKw0Vldap6","version":"1.0.3"} $ curl -X GET https://www.ff6wc.com/api/seed//null {"error":"Invalid seed id"} ===== Flag Info ===== ---- **Description** Query information about given flags **Endpoint** %%https://www.ff6wc.com/api/flags//%% **Method** GET **Returns** { "id" : "", "flags" : "" "url" : "", } **Errors** ^ Error Code ^ Reason ^ | 401 | Invalid or inactive API Key | | 404 | Invalid flags ID | **Examples** $ curl -X GET https://www.ff6wc.com/api/flags//Wtq78b6JWjly {"flags":"-cg -sl","id":"Wtq78b6JWjly","url":"https://www.ff6wc.com/flags/Wtq78b6JWjly"} $ curl -X GET https://www.ff6wc.com/api/flags//null {"error":"Invalid flags id"} ===== Patch File ===== ---- **Description** Retrieve binary patch file for given seed **Endpoint** %%https://www.ff6wc.com/api/patch//%% **Method** GET **Returns** Binary xdelta3 patch file **Errors** ^ Error Code ^ Reason ^ | 401 | Invalid or inactive API Key | | 404 | Patch file not found | | 500 | Failed to extract patch | **Examples** $ curl -X GET https://www.ff6wc.com/api/patch//24zKw0Vldap6 --output patch % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 31194 100 31194 0 0 676k 0 --:--:-- --:--:-- --:--:-- 676k $ curl -X GET https://www.ff6wc.com/api/patch//null {"error":"Patch file not found"} ===== Log File ===== ---- **Description** Retrieve text log file for given seed **Endpoint** %%https://www.ff6wc.com/api/log//%% **Method** GET **Returns** UTF-8 encoded text log file **Errors** ^ Error Code ^ Reason ^ | 401 | Invalid or inactive API Key | | 404 | Log file not found | | 500 | Failed to extract log | **Examples** $ curl -X GET https://www.ff6wc.com/api/log//24zKw0Vldap6 Version 1.0.3 Generated 2022-01-25 01:50:49 Input ff6.smc Output ff6wc_24zKw0Vldap6.smc Log ff6wc_24zKw0Vldap6.txt Website ff6wc.com/seed/24zKw0Vldap6 Seed myseed Flags -cg -sl Hash Banon, Vargas, Narshe Guard, Fish ... $ curl -X GET https://www.ff6wc.com/api/log//null {"error":"Log file not found"}