Skip to main content

sendSmsCode

AuthenticationTokenWrapper sendSmsCode(AuthRequestDto)

POST /api/2.0/authentication/sendsms

Send SMS code

Sends a new SMS authentication code to the phone number stored for the user and reports when that code expires. The credentials in the body are checked exactly as by POST api/2.0/authentication, so use this operation to resend the code after that call answered with sms; the user needs SMS two-factor enabled and a phone number already stored, which POST api/2.0/authentication/setphone registers. Open to unauthenticated callers, mutating and not idempotent: every call sends a message, is counted in the portal's SMS usage and spends one of the few codes a number is allowed within the code lifetime (ten minutes by default), after which the call fails until those codes expire. Codes sent earlier stay valid, so a resent code does not invalidate them, and the first one to be accepted invalidates all of them. The answer carries sms, the masked number and expires, and no token - submit the code to POST api/2.0/authentication/{code}.

Parameters​

NameInTypeDescriptionNotes
AuthRequestDtobodyAuthRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The masked phone number the code was sent to and the moment that code expires - no authentication token yetAuthenticationTokenWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body could not be validated, for example confirmData.email is not an email address--
401The password, the confirmation key or the third-party profile was rejected--
403The user is disabled, or too many failed attempts have blocked further sign-ins for these credentials--
404No user of this portal matches the credentials in the request body--
429The portal rate limiter rejected the call - retry after the interval in the Retry-After headerErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

AuthenticationTokenWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json