View Categories

Resend Phone verification code

πŸ“± 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 #

{
    "type": null,
    "title": null,
    "status": null,
    "detail": null,
    "instance": null,
    "ANY_ADDITIONAL_PROPERTY": "anything"
}


⚠️ 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 #

curl -X POST "https://api-test.10npay.com/User/2077/phone-number/resend-code" \ -H "Authorization: Bearer <YOUR_SECRET_TOKEN>" \ -i


5.2 C# (.NET) #

using System.Net.Http; using System.Threading.Tasks; var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Post, RequestUri = new Uri("https://api-test.10npay.com/User/2077/phone-number/resend-code"), Headers = { { "Authorization", "Bearer <YOUR_SECRET_TOKEN>" } } }; using var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); // Expect 204 No Content


5.3 JavaScript (fetch) #

await fetch("https://api-test.10npay.com/User/2077/phone-number/resend-code", { method: "POST", headers: { "Authorization": "Bearer <YOUR_SECRET_TOKEN>" } }); // Expect 204 No Content


6) πŸ”„ Sequence #

  1. Client β†’ API Gateway: POST /User/{id}/phone-number/resend-code (Bearer, no body)

  2. API Gateway β†’ Auth Service: Validate token

  3. Auth Service β†’ API Gateway: OK

  4. API Gateway β†’ SMS Service: Resend code

  5. SMS Service β†’ API Gateway: Accepted

  6. API Gateway β†’ Client: 204 No Content

Powered by BetterDocs