GDAP API: Synchronize Partner Customers

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 Synchronization flow.

Resource Links

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

Base URL: https://dev-gdap.azurewebsites.net/api/

 

API: Synchronize Partner's Customers
Url:
{baseurl}SynchronizePartnerCustomers
Method: POST

Parameters

Key Value Description
email helmuts.reinis@appxite.com Your AAD email address here
partnerId 918c6a1a-******-e0343eea7e0b Microsoft Partner Tenant Id

 

Headers

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

Example:
POST - https://dev-gdap.azurewebsites.net/api/SynchronizePartnerCustomers?partnerId=918c6a1a-******-e0343eea7e0b&email=helmuts.reinis@appxite.com

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

{
    "Result""Accepted",
    "Message""Your customers will be synchronized now."
}


Meantime, the service will initiate the sync of your customers from tenant's partner center and an email will be dispatched when complete.

mceclip0.png


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> SynchronizeCustomers(string baseUrl, string providerId, string bearer, string email)
{
string uri = $"{baseUrl}SynchronizePartnerCustomers?partnerId={providerId}&email={email}";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "POST";
request.Headers.Add("Authorization", $"Bearer {bearer}");
request.Accept = "application/json";
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 synccustomersResult = await gdapTemplateOps.SynchronizeCustomers(CurrentBaseUrl, cb_AvailableProviderIds.SelectedValue.ToString(), bearerToken.access_token, tb_Username.Text);

Was this article helpful?

0 out of 0 found this helpful

Add comment

Please sign in to leave a comment.