curl --request POST \--url 'https://api.botpoison.com/verify' \--header 'accept: application/json' \--header 'content-type: application/json' \--data '{"secretKey": "sk_xxxxxxxx", "solution": "xxxxxxxx"}'
// The status is always 200. Read "ok" to decide whether to accept the// submission; "message" is only present when "ok" is false.// Accepted{ "ok": true }// Rejected, with the reason{ "ok": false, "message": "Invalid solution" }
You can use the special secret key test with the following special solution strings to simulate specific responses.
// Use solution="ok" to simulate a successful verificationconst OK_REQUEST_DATA = { secretKey: "test", solution: "ok" }const OK_RESPONSE = { ok: true }// Use solution="nok" to simulate an unsuccessful verificationconst NOT_OK_DATA = { secretKey: "test", solution: "nok" }const NOT_OK_RESPONSE = { ok: false }