GDAP API: Transition Customer With Template Roles
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 Transition based on the template data flow.
Resource Links
Swagger UI - https://dev-gdap.azurewebsites.net/api/swagger/ui
Base URL: https://dev-gdap.azurewebsites.net/api/
API: Migrate Customer By Template
Url: {baseurl}MigrateCustomerByTemplate
Method: POST
Parameters
Key | Value | Description |
providerId | 918c6a1a-******-e0343eea7e0b | Microsoft Partner Tenant Id |
templateId |
2d4dc098-a298-46ec-8a93-c969477a693d
|
Id of your published Template |
customerId |
f827d5fb-****-43d9-870f-426afcc52d77
|
Microsoft Customer Tenant Id that is present under your Partner Tenant |
duration | P2Y | Provide desired duration |
Headers
Key | Value | Description |
Authorization | Bearer {accesstoken} | Your access token here |
Example:
POST - https://dev-gdap.azurewebsites.net/api/MigrateCustomerByTemplate?providerId=918c6a1a-****-43ec-a8ea-e0343eea7e0b&templateId=2d4dc098-a298-46ec-8a93-c969477a693d&customerId=f827d5fb-****-43d9-870f-426afcc52d77&duration=P2Y
JSON Response 1 (If access is valid and the account has permissions) :
{
"Result": "Accepted",
"Message": [
"Access Role Id Assigned Successfully: f023fd81-a637-4b56-95fd-791ac0226033",
"Access Role Id Assigned Successfully: eb1f4a8d-243a-41f0-9fbd-c7cdf6c5ef7c",
"Access Role Id Assigned Successfully: d37c8bed-0711-4417-ba38-b4abe66ce4c2",
"Access Role Id Assigned Successfully: 194ae4cb-b126-40b2-bd5b-6091b380977d",
"Access Role Id Assigned Successfully: fe930be7-5e62-47db-91af-98c3a49a38b1",
"Access Role Id Assigned Successfully: fdd7a751-b60b-444a-984c-02652fe8fa1c"
]
}
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> MigrateCustomer(string baseUrl, string providerId, string bearer, string templateId, string customerId, string duration)
{
string uri = $"{baseUrl}MigrateCustomerByTemplate?providerId={providerId}&templateId={templateId}&customerId={customerId}&duration={duration}";
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;
request.ContentLength = 0;
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 migrateCustomer = await gdapTemplateOps.MigrateCustomer(
CurrentBaseUrl,
ProviderId,
bearerToken.access_token,
TemplateId,
CustomerId,
Duration
);
Was this article helpful?
Articles in this section
- GDAP API: Express Customer Transition
- GDAP API: Delete Published Template
- GDAP API: Transition Customer With Template Roles
- GDAP API: Get Published Templates
- GDAP API: Provision Security Groups Based On Template Roles
- GDAP API: Publish Customized Template
- GDAP API: Get Roles
- GDAP API: Get Relationships
- GDAP API: List Customers
- GDAP API: Synchronize Partner Customers
Add comment
Please sign in to leave a comment.