Перейти до вмісту
NimbusNexus

Підтвердження телефону

Підтвердження телефону додає номер до вашого користувача й перевіряє, що повідомлення на нього до вас доходять. Підтвердження відбувається за стандартною схемою «ми надсилаємо код у SMS, ви його вводите».

POST /api/v1/phone/ приймає phone_code (телефонний код країни, лише цифри) і phone_number та надсилає на цей номер SMS із шестизначним кодом. Код дійсний 10 хвилин. POST /api/v1/phone/phone_passcode_validation із цим кодом у passcode позначає номер як підтверджений. GET /api/v1/phone/ показує підтверджений номер, а DELETE /api/v1/phone/ видаляє його. Щоб змінити номер, почніть спочатку з POST /api/v1/phone/.

Підтверджений номер не є ні другим фактором, ні каналом відновлення. Двофакторна автентифікація використовує код TOTP, а втрачений пароль скидають через електронну пошту (див. Огляд акаунта).

Що далі

Reference

GET/api/v1/phone/

Retrieve Phone

Return the verified phone number on file for the current user, if any.

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X GET "https://api.nimbusnexus.net/api/v1/phone/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/phone/

Add Phone

Stage a phone number for the current user and send a one-time SMS verification code to it.

Request body

FieldTypeDescription
phone_code*string—
phone_number*string—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/phone/" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone_code": "example",
    "phone_number": "example"
  }'
DELETE/api/v1/phone/

Delete Phone

Remove the current user's verified phone number and disable two-factor authentication.

Responses

  • 204Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X DELETE "https://api.nimbusnexus.net/api/v1/phone/" \
  -H "Authorization: Bearer $NIMBUS_KEY"
POST/api/v1/phone/phone_passcode_validation

Phone Passcode Validation

Validate the SMS passcode and promote the staged phone number to verified.

Request body

FieldTypeDescription
passcode*string—

Responses

  • 200Successful Response
  • 400Bad Request
  • 401Unauthorized
  • 403Forbidden
  • 404Not Found
  • 409Conflict
  • 422Validation error
  • 429Too Many Requests
  • 500Internal Server Error

Example

curl -X POST "https://api.nimbusnexus.net/api/v1/phone/phone_passcode_validation" \
  -H "Authorization: Bearer $NIMBUS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "passcode": "example"
  }'

Need to make a real call? Try these endpoints in the live Swagger UI →