Verifying solutions with the Rest API
Request
URL: https://api.botpoison.com/verify
Method: POST
bash
curl --request POST \--url 'https://api.botpoison.com/verify' \--header 'accept: application/json' \--header 'content-type: application/json' \--data '{"secretKey": "sk_xxxxxxxx", "solution": "xxxxxxxx"}'
Response
javascript
// 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" }
Testing your integration
You can use the special secret key test with the following special solution strings to simulate specific responses.
javascript
// 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 }