Przejdź do głównej zawartości

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.

errorcodeHTTPerrormessageCause
err1400trueCould not find required parameters or they are wrongMalformed parameters, or no SMS history at all for the client + service pair
err2200falseCode does not existsThe code does not exist for this client + service pair
err3200falseCode usedThe code has already been consumed

Request

Responses

Verification result or an err2/err3 error - both share HTTP 200. Check the status field to tell them apart.