Ir para o conteúdo
NimbusNexus

Verificação de telefone

A verificação de telefone adiciona um número de telefone ao seu usuário e confere se ele chega até você. A verificação é o fluxo padrão "enviamos um código por SMS, você o digita".

POST /api/v1/phone/ recebe um phone_code (o código de discagem do país, só dígitos) e um phone_number, e envia por SMS um código de seis dígitos para esse número. O código vale por 10 minutos. POST /api/v1/phone/phone_passcode_validation com esse passcode marca o número como verificado. GET /api/v1/phone/ mostra o número verificado, e DELETE /api/v1/phone/ o remove. Para trocar o número, comece de novo com POST /api/v1/phone/.

Um número verificado não é um segundo fator nem um canal de recuperação. A autenticação de dois fatores usa um código TOTP, e uma senha perdida é redefinida por e-mail (veja Visão geral da conta).

Próximos passos

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 →