π± Phone Number β Resend Verification Code API #
Gateway Path: /User/{id}/phone-number/resend-code
Service: Authentication & Authorization
Method: POST
Auth: Bearer token in Authorization header
1) π Overview & Purpose #
This endpoint resends a one-time SMS verification code to the userβs phone number.
It is useful when a user did not receive or has lost the initial code.
2) π Endpoint Definition #
HTTP: POST /User/{id}/phone-number/resend-code
Headers #
-
Authorization: Bearer <token>
β valid access token. -
Content-Length: 0
β no request body.
Path Parameters #
-
id (integer, required, int32) β The user identifier.
Request Body #
-
None
3) π‘ Responses #
β 3.1 Success β 204 No Content #
Request accepted; a new SMS with a verification code was issued.
β 3.2 Not Found β 404 #
β οΈ 3.3 Server Error β 500 Internal Server Error #
Empty body, indicates an unexpected failure.
4) π‘ Validation Rules #
-
id: required; integer between 1 and 2147483647 (signed 32-bit).
-
The user must have a phone number on file.
-
Service may enforce throttling (e.g., max resend attempts per time window).
5) π» Examples #
5.1 cURL #
5.2 C# (.NET) #
5.3 JavaScript (fetch) #
6) π Sequence #
-
Client β API Gateway:
POST /User/{id}/phone-number/resend-code
(Bearer, no body) -
API Gateway β Auth Service: Validate token
-
Auth Service β API Gateway: OK
-
API Gateway β SMS Service: Resend code
-
SMS Service β API Gateway: Accepted
-
API Gateway β Client:
204 No Content