GDAP API: User Registration
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 User Registration flow.
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}UserRegistration
Method: POST
Parameters
| Key | Value | Description |
| helmuts.reinis@appxite.com | Your AAD email address here | |
| firstname | Helmuts | Your firstname here |
| lastname | Reinis | Your lastname here |
Example
POST - https://gdapbridge360.azurewebsites.net/api/UserRegistration?email=helmuts.reinis@appxite.com&firstname=Helmuts&lastname=Reinis
JSON Response 1 (If access is already registered) :
{
"Result": "Denied",
"Message": "It appears that this account is already registered: helmuts.reinis@appxite.com"
}
JSON Response 2 (Account with no prior association):
{
"Result": "Accepted",
"Message": "Expect an email in your inbox with more information: helmuts.reinis@appxite.com"
}
C# Method Example:
public async Task<string> NewUserRegistration(string baseUrl, string Username, string FirstName, string LastName)
{
string uri = $"{baseUrl}UserRegistration?email={Username}&firstname={FirstName}&lastname={LastName}";
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 RegistrationResult = await loginAPI.NewUserRegistration(CurrentBaseUrl, Username, FirstName, LastName);
Summary
The GDAP API user registration endpoint uses a POST method at https://gdapbridge360.azurewebsites.net/api/UserRegistration with email, firstname, and lastname parameters. The API returns a JSON response with Result and Message fields: "Denied" with a message indicating the account is already registered if the email exists in the system, or "Accepted" with a confirmation message stating an email will be sent to the provided address for new registrations. The C# implementation demonstrates creating an HttpWebRequest with POST method, constructing the URI with query parameters, and reading the response asynchronously to retrieve the registration result. 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.