Verify SMS Code
GET/api/v1/sms/verify/:client/:service/:code
Verify an SMS Premium code submitted by a user.
A successful call consumes the code: it is marked as used and the caller IP and usage date are stored. Calling again for the same code returns err3. Treat this as a write operation, not a status read - call it once and persist the result.
Error handling
Errors share one envelope: { status: false, error, errorcode, message }. Branch on status - neither error nor the HTTP status code is a reliable indicator, because error is false for two of the three cases.
errorcode | HTTP | error | message | Cause |
|---|---|---|---|---|
err1 | 400 | true | Could not find required parameters or they are wrong | Malformed parameters, or no SMS history at all for the client + service pair |
err2 | 200 | false | Code does not exists | The code does not exist for this client + service pair |
err3 | 200 | false | Code used | The code has already been consumed |
Request
Responses
- 200
- 400
Verification result or an err2/err3 error - both share HTTP 200. Check the status field to tell them apart.
err1 - malformed parameters, or no SMS history for the client + service pair.