Implementation of 2-factor authentication

GET /api/v1/createPasswordObject Creating a PasswordObject
Request URL
GET https://app.sms.by/api/v1/createPasswordObject

Parameters

Parameter Location Type Required Description
token query string Yes Your API key
type_id query string Yes Can take the following values: letters - only letters of the Latin alphabet, numbers - only numbers, both - mixed type
len query integer Yes Password length from 1 to 16

Responses

200 — Completed successfully

{
    "result": {
        "password_object_id": 243
    }
}

400 — Incorrect request

404 — Page not found

429 — Request limit exceeded

500 — Server is not available

GET /api/v1/getPasswordObjects Get all PasswordObjects
Request URL
GET https://app.sms.by/api/v1/getPasswordObjects

Parameters

Parameter Location Type Required Description
token query string Yes Your API key

Responses

200 — Completed successfully

400 — Incorrect request

404 — Page not found

429 — Request limit exceeded

500 — Server is not available

GET /api/v1/getPasswordObject Get PasswordObject by ID
Request URL
GET https://app.sms.by/api/v1/getPasswordObject

Parameters

Parameter Location Type Required Description
token query string Yes Your API key
id query integer Yes Object ID returned from createPasswordObject

Responses

200 — Completed successfully

400 — Incorrect request

404 — Page not found

429 — Request limit exceeded

500 — Server is not available

GET /api/v1/editPasswordObject Editing a PasswordObject
Request URL
GET https://app.sms.by/api/v1/editPasswordObject

Parameters

Parameter Location Type Required Description
token query string Yes Your API key
id query integer Yes Object ID returned from createPasswordObject
type_id query string Yes Can take the following values: letters - only letters of the Latin alphabet, numbers - only numbers, both - mixed type
len query integer Yes Password length from 1 to 16

Responses

200 — Completed successfully

{
    "result": "1"
}

400 — Incorrect request

404 — Page not found

429 — Request limit exceeded

500 — Server is not available

GET /api/v1/deletePasswordObject Deleting a PasswordObject
Request URL
GET https://app.sms.by/api/v1/deletePasswordObject

Parameters

Parameter Location Type Required Description
token query string Yes Your API key
id query integer Yes Object ID returned from createPasswordObject

Responses

200 — Completed successfully

{
    "result": "1"
}

400 — Incorrect request

404 — Page not found

429 — Request limit exceeded

500 — Server is not available

GET /api/v1/sendSmsMessageWithCode Send SMS with confirmation code
Request URL
GET https://app.sms.by/api/v1/sendSmsMessageWithCode

Parameters

Parameter Location Type Required Description
token query string Yes Your API key
password_object_id query integer Yes Object ID returned from createPasswordObject
phone query string Yes Phone number
message query string Yes the message must contain a variable for substitution %CODE%) For example: message = Your password: %CODE%
alphaname_id query integer No see usage of Alpha names

Responses

200 — Completed successfully

{
    "status": "ok",
    "parts": 1,
    "len": 21,
    "sms_id": 2208471,
    "code": "GAYXILYZOX"
}

400 — Incorrect request

404 — Page not found

429 — Request limit exceeded

500 — Server is not available