GDAP API: Get Relationships

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 GDAP Relationship Listing flow.

Resource Links

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

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


Url:
{baseurl}Relationships
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/Relationships?providerId=918c6a1a-3*******-e0343eea7e0b

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

[
{
"partitionKey": "853c0c1b-4661-41cd-9f38-4d059311ee8a",
"rowKey": "000eae3c-24d5-46d3-a38e-ddf45142e8c5-853c0c1b-4661-41cd-9f38-4d059311ee8a",
"timestamp": "2024-08-26T16:12:15.6770567+00:00",
"eTag": {},
"displayName": "0fedf81a-7fd9-49f6-8a41-5a60eae9755a_gdap_W9494",
"duration": "P730D",
"status": "active",
"createdDateTime": "2023-05-19T09:20:46.3749507Z",
"activatedDateTime": "2023-05-19T09:20:49.4958348Z",
"lastModifiedDateTime": "2023-05-19T09:20:49.4958348Z",
"endDateTime": "2025-05-18T09:20:49.4958348Z",
"autoExtendDuration": "PT0S",
"customerId": "0fedf81a-xxxx-49f6-8a41-5a60eae9755a",
"customerName": "xxxxx xxxxx",
"accessAssignments": "[{\"@odata.etag\":\"W/\\\"JyIwYjAwNTlmNi0wMDAwLTE5MDAtMDAwMC02NDY3M2Y5MDAwMDAiJw==\\\"\",\"id\":\"02284eef-3166-4e79-8078-fa1a867b9c9f\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:00.2519581Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:20.8818474Z\",\"accessContainer\":{\"accessContainerId\":\"0c04629c-094d-4386-bb73-c45d601ba23a\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG License administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"4d6ac14f-3453-41d0-bef9-a3e0c569773a\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwOWJmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiNzAwMDAiJw==\\\"\",\"id\":\"112457df-c4ee-4992-87fa-18f5acd172ef\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:40.3418791Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:59.7433862Z\",\"accessContainer\":{\"accessContainerId\":\"eef0a9cb-b4f8-469c-8591-df1c2ec5bab3\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Insights administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"eb1f4a8d-243a-41f0-9fbd-c7cdf6c5ef7c\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwYzdmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiOTAwMDAiJw==\\\"\",\"id\":\"14226cf0-6ae4-4195-b7be-80e74c5ab410\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:42.7321534Z\",\"lastModifiedDateTime\":\"2023-05-19T09:22:01.664131Z\",\"accessContainer\":{\"accessContainerId\":\"6a8c07ed-770d-49ec-90e2-2a4be9563f98\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Global reader\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"f2ef992c-3afb-46b9-b7cf-a126ee74c451\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwOTNmOC0wMDAwLTE5MDAtMDAwMC02NDY3M2Y5ZTAwMDAiJw==\\\"\",\"id\":\"196444e9-8588-4c4c-aa52-5a4c0c4198de\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:05.5443187Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:34.4711256Z\",\"accessContainer\":{\"accessContainerId\":\"1027faf3-960c-451c-bd62-066dbcb8d595\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Security administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"194ae4cb-b126-40b2-bd5b-6091b380977d\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwNThmYS0wMDAwLTE5MDAtMDAwMC02NDY3M2ZhYTAwMDAiJw==\\\"\",\"id\":\"21186784-1053-473f-ac04-22d93d9aab91\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:24.5834063Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:46.6407866Z\",\"accessContainer\":{\"accessContainerId\":\"fffb9cce-d26e-400a-a867-91016b77881f\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Helpdesk administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"729827e3-9c14-49f7-bb1b-9608f156bbb8\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwZGVmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiYTAwMDAiJw==\\\"\",\"id\":\"2a62e25d-85a5-4362-8f88-d03161a22ae2\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:43.9238911Z\",\"lastModifiedDateTime\":\"2023-05-19T09:22:02.7966382Z\",\"accessContainer\":{\"accessContainerId\":\"a98f715c-433f-4546-af40-f9150f887772\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG SharePoint administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"f28a1f50-f6e7-4571-818b-6a12f2af6b6c\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwMjlmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiMjAwMDAiJw==\\\"\",\"id\":\"31bd51b0-97a9-4b0f-a89d-ebf7def15d79\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:31.9096479Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:54.4947535Z\",\"accessContainer\":{\"accessContainerId\":\"d167fc0f-4b04-416e-96b4-4fa8ba511b80\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Directory writers\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"9360feb5-f418-4baa-8175-e2a00bac4301\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwN2ZmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiNjAwMDAiJw==\\\"\",\"id\":\"31ce52eb-61b2-4a36-8a6e-8a6d43748a4b\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:38.0198364Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:58.1728043Z\",\"accessContainer\":{\"accessContainerId\":\"78cbf7e8-72b6-4f53-81d4-7ebc39b911bb\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Billing administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"b0f54661-2d74-4c50-afa3-1ec803f12efe\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwYzFmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiOTAwMDAiJw==\\\"\",\"id\":\"32fec3f2-636f-41b6-b8dc-298e20bd7b75\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:41.5542435Z\",\"lastModifiedDateTime\":\"2023-05-19T09:22:01.4633471Z\",\"accessContainer\":{\"accessContainerId\":\"a1c61d68-8afb-4d03-b0f3-98e61e2bffe4\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Service support administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"f023fd81-a637-4b56-95fd-791ac0226033\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwMDBmYy0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiYzAwMDAiJw==\\\"\",\"id\":\"50fa7546-3a79-4278-b2ef-fcb5f206a514\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:48.8523638Z\",\"lastModifiedDateTime\":\"2023-05-19T09:22:04.5838889Z\",\"accessContainer\":{\"accessContainerId\":\"5604945a-f824-4933-9b1b-896831fcd2cf\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Teams communications support specialist\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"fcf91098-03e3-41a9-b5ba-6f0ec8188a12\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwOTVmNy0wMDAwLTE5MDAtMDAwMC02NDY3M2Y5OTAwMDAiJw==\\\"\",\"id\":\"59e0fdf3-5e5e-483a-9e60-a0d0d00b0e1a\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:03.0956278Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:28.9241848Z\",\"accessContainer\":{\"accessContainerId\":\"4567a5c7-e95a-4efd-88c6-fb602533c3ef\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Intune administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"3a2c62db-5318-420d-8d74-23affee5d9d5\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwNmFmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiNTAwMDAiJw==\\\"\",\"id\":\"5a89f1d0-7b74-43ec-a4f5-1b2fc480c5cf\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:36.6875706Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:57.6049728Z\",\"accessContainer\":{\"accessContainerId\":\"bbf7f5b0-48e0-4e10-9df4-4bf97fcf590c\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Application administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"9b895d92-2cd3-44c7-9d02-a6ac2d5ea5c3\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwNjdmYS0wMDAwLTE5MDAtMDAwMC02NDY3M2ZhYjAwMDAiJw==\\\"\",\"id\":\"62eb960b-255b-4e99-8561-c4d6fb24ece4\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:27.2466675Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:47.1266198Z\",\"accessContainer\":{\"accessContainerId\":\"5cb2c437-7687-4126-afd0-ef2ea67ee0f9\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Usage summary reports reader\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"75934031-6c7e-415a-99d7-48dbd49e875e\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwZWNmNy0wMDAwLTE5MDAtMDAwMC02NDY3M2Y5YTAwMDAiJw==\\\"\",\"id\":\"6f90b4ce-09ea-4023-894d-9adaeb312144\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:04.4194682Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:30.5643046Z\",\"accessContainer\":{\"accessContainerId\":\"57ed9755-243b-4d06-bb35-a6490d61d4c9\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Windows 365 administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"11451d60-acb2-45eb-a7d6-43d0f0125c13\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwZjdmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiYzAwMDAiJw==\\\"\",\"id\":\"7df3f3ed-b2e9-47ac-bd01-cd7e832f9d6f\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:47.7780343Z\",\"lastModifiedDateTime\":\"2023-05-19T09:22:04.0115034Z\",\"accessContainer\":{\"accessContainerId\":\"2775fd77-9f6f-42c5-b4f0-9fb081e934a8\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Teams communications support engineer\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"f70938a0-fc10-4177-9e90-2178f8765737\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwZjJmOS0wMDAwLTE5MDAtMDAwMC02NDY3M2ZhNzAwMDAiJw==\\\"\",\"id\":\"8f2dd02c-c357-4466-a79c-0f6d77c424cd\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:23.4495284Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:43.3356659Z\",\"accessContainer\":{\"accessContainerId\":\"43454370-eb1a-4d83-b1fa-577c9790592f\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Teams administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"69091246-20e8-4a56-aa4d-066075b2a7a8\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwOGJmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiNzAwMDAiJw==\\\"\",\"id\":\"8f775f62-f2dd-4ea2-8c64-ad6b3363900d\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:39.1755984Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:59.1090663Z\",\"accessContainer\":{\"accessContainerId\":\"4647af6a-3e19-491d-af00-5f80f68427fb\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Teams communications administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"baf37b3a-610e-45da-9e62-d9d1e5e8914b\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwNWZmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiNDAwMDAiJw==\\\"\",\"id\":\"97173669-1499-4832-9484-24e384761583\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:35.6268685Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:56.8937833Z\",\"accessContainer\":{\"accessContainerId\":\"9a0ca876-e923-46fe-8161-7c66d140aa13\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Password administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"966707d0-3269-4727-9be2-8c3a10f19b9d\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwNDdmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiMzAwMDAiJw==\\\"\",\"id\":\"a35f456a-1f20-4a64-a1f1-fc3c0145a891\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:33.0881255Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:55.4967353Z\",\"accessContainer\":{\"accessContainerId\":\"03c13bd9-20b3-49c3-8e5a-5d1afa968758\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Guest inviter\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"95e79109-95c0-4d8e-aee3-d01accf2d47b\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwZmRmYS0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiMDAwMDAiJw==\\\"\",\"id\":\"a4bf91ec-bafd-4481-92b0-8394d070bce2\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:29.1896547Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:52.6359784Z\",\"accessContainer\":{\"accessContainerId\":\"72bb1121-adef-4013-8186-b955d88c78bf\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Cloud device administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"7698a772-787b-4ac8-901f-60d6b08affd2\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwZWRmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiYjAwMDAiJw==\\\"\",\"id\":\"a78ff966-116d-49de-847b-a1f75b7eaacc\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:46.1712551Z\",\"lastModifiedDateTime\":\"2023-05-19T09:22:03.5116814Z\",\"accessContainer\":{\"accessContainerId\":\"def02b74-dd08-4d41-82f9-2772b9b79d97\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Groups administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"fdd7a751-b60b-444a-984c-02652fe8fa1c\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwYjRmOC0wMDAwLTE5MDAtMDAwMC02NDY3M2Y5ZjAwMDAiJw==\\\"\",\"id\":\"ae8eb41b-6d90-4001-95c2-e9f0ccdc7703\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:08.2353053Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:35.4252098Z\",\"accessContainer\":{\"accessContainerId\":\"d3d4981f-bc1a-4ce8-a048-7e60c9e41ba9\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Office apps administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"2b745bdf-0803-4d80-aa65-822c4493daac\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwZDdmNi0wMDAwLTE5MDAtMDAwMC02NDY3M2Y5NDAwMDAiJw==\\\"\",\"id\":\"b0dd40c5-8dd4-421b-b3ee-bfbc5b9f330f\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:01.4656831Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:24.7697145Z\",\"accessContainer\":{\"accessContainerId\":\"ee497720-bb91-4457-8b00-c15dc7cc1be0\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Dynamics 365 administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"44367163-eba1-44c3-98af-f5787879f96a\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwYWFmOC0wMDAwLTE5MDAtMDAwMC02NDY3M2Y5ZjAwMDAiJw==\\\"\",\"id\":\"c86bd95b-5e44-4183-b5a7-2341dde05503\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:07.0033572Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:35.066849Z\",\"accessContainer\":{\"accessContainerId\":\"17dc6275-06b5-49ce-8939-c022252a7270\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Exchange administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"29232cdf-9323-42fd-ade2-1d097af3e4de\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwZTNmYi0wMDAwLTE5MDAtMDAwMC02NDY3M2ZiYjAwMDAiJw==\\\"\",\"id\":\"e3c97f65-6d31-49f2-b609-5da202f6d00b\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:45.0904772Z\",\"lastModifiedDateTime\":\"2023-05-19T09:22:03.0589713Z\",\"accessContainer\":{\"accessContainerId\":\"c46013c2-471f-41ef-9559-4857da8f5df1\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG User administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"fe930be7-5e62-47db-91af-98c3a49a38b1\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwZGFmYS0wMDAwLTE5MDAtMDAwMC02NDY3M2ZhZjAwMDAiJw==\\\"\",\"id\":\"ee61f461-d75f-4fe5-8e66-d61160a0c0c2\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:30.3421544Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:51.4948969Z\",\"accessContainer\":{\"accessContainerId\":\"68b0a2e5-fe42-4bd7-9999-c7aae466eede\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Directory readers\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"88d8e3e3-8f55-4a1e-953a-9b9898b8876b\"}]}},{\"@odata.etag\":\"W/\\\"JyIwYjAwODdmOS0wMDAwLTE5MDAtMDAwMC02NDY3M2ZhNDAwMDAiJw==\\\"\",\"id\":\"ee8ea485-9342-487e-920c-80d352955894\",\"status\":\"active\",\"createdDateTime\":\"2023-05-19T09:21:19.8890833Z\",\"lastModifiedDateTime\":\"2023-05-19T09:21:40.6484454Z\",\"accessContainer\":{\"accessContainerId\":\"09618f24-100e-4bd9-80de-d662f36f92ef\",\"accessContainerType\":\"securityGroup\",\"DisplayName\":\"CSP-SG Teams devices administrator\"},\"accessDetails\":{\"unifiedRoles\":[{\"roleDefinitionId\":\"3d762c5a-1b6c-493f-843e-55a3b42923d4\"}]}}]"
},

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> GetGdapRelationships(string baseUrl, string providerId, string bearer)
{
string uri = $"{baseUrl}GetRelationships?providerId={providerId}";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "GET";
request.Headers.Add("Authorization", $"Bearer {bearer}");
request.Accept = "application/json";
request.ContentType = "application/json";
request.Expect = "application/json";

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 getCurrentRelationships = await gdapTemplateOps.GetGdapRelationships(CurrentBaseUrl, "ProviderIdhere", bearerToken.access_token);

Was this article helpful?

0 out of 0 found this helpful

Add comment

Please sign in to leave a comment.