GDAP API: List Customers

Appxite

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 Customer Listing flow.

In this article:

Resource Links

Swagger UI - https://gdapbridge360.azurewebsites.net/api/swagger/ui

Base URL: https://gdapbridge360.azurewebsites.net/api/

Parameters

Url: {baseurl}Customers
Method: GET

Parameters

Key Value Description
providerId 918c6a1a-******-e0343eea7e0b Microsoft Partner Tenant Id

Headers

Key Value Description
Authorization Bearer {accesstoken} Your access token here

Example

GET - https://gdapbridge360.azurewebsites.net/api/Customers?providerId=918c6a1a-3*******-e0343eea7e0b

JSON Response 1 (If access is valid and the account has permissions) :
 

{
    "CurrentEntitiesSynced": [
        {
            "TenantDomain": "qa2domain.onmicrosoft.com",
            "CompanyName": "QA2 reseller",
            "PrimaryContact": "adam.lambrou@appxite.com",
            "FirstName": "Prim",
            "LastName": "Fernando",
            "PartitionKey": "918c6a1a-339c-43ec-a8ea-e0343eea7e0b",
            "RowKey": "06e8cf15-610a-4e63-b1ad-49bb7b9356cc",
            "Timestamp": null,
            "ETag": {}
        },
        .......
        .......
    ]
}

JSON Response 2 (If the access token is not valid or lacks permissions for the call):
 

null

Response type will default to - 401 (Unauthorized)


C# Method Example:
 

public async Task<string> GetCustomers(string baseUrl, string providerId, string bearer)
{
    string uri = $"{baseUrl}ListCustomers?providerId={providerId}";
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
    request.Method = "GET";
    request.Headers.Add("Authorization", $"Bearer {bearer}");
    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 getCurrentCustomers = await gdapTemplateOps.GetCustomers(CurrentBaseUrl, cb_AvailableProviderIds.SelectedValue.ToString(), bearerToken.access_token);

Summary

The GDAP API customer listing endpoint uses a GET method at https://gdapbridge360.azurewebsites.net/api/Customers with the providerId parameter (Microsoft Partner Tenant ID) and requires an Authorization header with a Bearer access token. A successful request returns a JSON response containing CurrentEntitiesSynced array with customer details including TenantDomain, CompanyName, PrimaryContact, FirstName, LastName, PartitionKey, RowKey, Timestamp, and ETag. Invalid or insufficient permissions return a null response with 401 Unauthorized status. The C# implementation demonstrates creating an HttpWebRequest with GET method, adding the Authorization header with the bearer token, and reading the response asynchronously to retrieve the customer list. Complete API documentation is available through the Swagger UI at https://gdapbridge360.azurewebsites.net/api/swagger/ui.

Was this article helpful?

0 out of 0 found this helpful

Add comment

Please sign in to leave a comment.