GDAP API: Account Activation and Recovery
Introduction
This article is describing our current GDAP API endpoint parameters, payloads and which call methods to use for specific tasks, and how to combine these workflows in C# implementation for Account Activation and Recovery.
In this article:
Resource Links
Resource Links
Swagger UI - https://gdapbridge360.azurewebsites.net/api/swagger/ui
Base URL: https://gdapbridge360.azurewebsites.net/api/
Parameters
Url: {baseurl}SecurityCode
Method: POST
Parameters
| Key | Value | Description |
| helmuts.reinis@appxite.com | Your AAD email address here | |
| reset | true | Instruct API to initiate the token reset flow |
| code | 123456 | Provide your security code that is received through email |
Example
Step 1 - Initiate Access Reset flow:
POST - https://gdapbridge360.azurewebsites.net/api/SecurityCode?email=helmuts.reinis@appxite.com&reset=true
JSON Response 1 (If Account is registered) :
true
An email will arrive in your Inbox:
JSON Response 1 (If Account is not registered) :
false
Example - Step 2 - Complete Access Reset flow:
POST - https://gdapbridge360.azurewebsites.net/api/SecurityCode?email=helmuts.reinis@appxite.com&code=590304
JSON Response 1 (If the wrong code is provided) :
{
"Result": "Accepted",
"Message": "false"
}JSON Response 2 (Code Entered correctly) :
{
"Result": "Accepted",
"Message": "01vh2..........n97an"
}
In addition, an email will be dispatched to your inbox with the same information:
C# Method Example - Send Reset Request:
public async Task<string> SendResetRequest(string baseUrl, string Username)
{
string uri = $"{baseUrl}SecurityCode?email={Username}&reset=true";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "POST";
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
using (HttpWebResponse response = (HttpWebResponse)await request.GetResponseAsync())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
return await reader.ReadToEndAsync();
}
}
Calling this method from code:
var initiateCodeReset = await loginAPI.SendResetRequest(CurrentBaseUrl, Username);
C# Method Example - Send Code Validation Request:
public async Task<string> ValidateSecurityCode(string baseUrl, string Username, string Code)
{
string uri = $"{baseUrl}SecurityCode?email={Username}&code={Code}";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "POST";
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
using (HttpWebResponse response = (HttpWebResponse)await request.GetResponseAsync())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
return await reader.ReadToEndAsync();
}
}
Calling this method from code:
var verifyCodeResult = await loginAPI.ValidateSecurityCode(CurrentBaseUrl, Username, SecurityCode);Summary
The GDAP API account activation and recovery endpoint uses a POST method at https://gdapbridge360.azurewebsites.net/api/SecurityCode with email, reset, and code parameters in a two-step process. Step 1 initiates the access reset flow by sending a POST request with email and reset=true parameters, returning true if the account is registered (with a security code sent via email) or false if not registered. Step 2 completes the reset by sending a POST request with email and the received security code, returning a JSON response with Result "Accepted" and either "false" for incorrect codes or the new password token for correct codes, followed by a confirmation email. The C# implementation includes two methods: SendResetRequest to initiate the reset flow and ValidateSecurityCode to verify the security code, both using HttpWebRequest with POST method and reading responses asynchronously. Complete API documentation is available through the Swagger UI at https://gdapbridge360.azurewebsites.net/api/swagger/ui.
Add comment
Please sign in to leave a comment.