Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Visual FoxPro) Microsoft Teams - List Team MembersGet the members of a team. For more information, see https://docs.microsoft.com/en-us/graph/api/team-list-members?view=graph-rest-1.0
LOCAL loHttp LOCAL lnSuccess LOCAL loSbResponseBody LOCAL loJResp LOCAL lnRespStatusCode LOCAL lcOdata_type LOCAL lcId LOCAL lcDisplayName LOCAL lcUserId LOCAL lcEmail LOCAL j LOCAL lnCount_j LOCAL lcStrVal LOCAL lcOdata_context LOCAL lnOdata_count LOCAL i LOCAL lnCount_i * This example assumes the Chilkat API to have been previously unlocked. * See Global Unlock Sample for sample code. * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http') loHttp = CreateObject('Chilkat.Http') * Implements the following CURL command: * curl -X GET https://graph.microsoft.com/v1.0/teams/{teamsId}/members \ * -H 'authorization: Bearer ACCESS_TOKEN' * Use the following online tool to generate HTTP code from a CURL command * Convert a cURL Command to HTTP Source Code * Adds the "Authorization: Bearer ACCESS_TOKEN" header. loHttp.AuthToken = "ACCESS_TOKEN" loHttp.SetUrlVar("teamsId","285c8d65-d8b5-447a-91c7-85593d50c826") * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder') loSbResponseBody = CreateObject('Chilkat.StringBuilder') lnSuccess = loHttp.QuickGetSb("https://graph.microsoft.com/v1.0/teams/{$teamsId}/members",loSbResponseBody) IF (lnSuccess = 0) THEN ? loHttp.LastErrorText RELEASE loHttp RELEASE loSbResponseBody CANCEL ENDIF * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject') loJResp = CreateObject('Chilkat.JsonObject') loJResp.LoadSb(loSbResponseBody) loJResp.EmitCompact = 0 ? "Response Body:" ? loJResp.Emit() lnRespStatusCode = loHttp.LastStatus ? "Response Status Code = " + STR(lnRespStatusCode) IF (lnRespStatusCode >= 400) THEN ? "Response Header:" ? loHttp.LastHeader ? "Failed." RELEASE loHttp RELEASE loSbResponseBody RELEASE loJResp CANCEL ENDIF * Sample JSON response: * (Sample code for parsing the JSON response is shown below) * { * "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#teams('285c8d65-d8b5-447a-91c7-85593d50c826')/members", * "@odata.count": 1, * "value": [ * { * "@odata.type": "#microsoft.graph.aadUserConversationMember", * "id": "Mjg1YzhkNjUtZDhiNS00NDdhLTkxYzctODU1OTNkNTBjODI2IyM0ZWU3MzJjMz0zMjJlLTRhNmItYjcyOS0yZmQxZWI1YzYwMDQ=", * "roles": [ * "owner" * ], * "displayName": "Joe Smith", * "userId": "4ee732c3-322e-4a6b-b729-2fd1eb5c6004", * "email": "admin@chilkat365.com" * } * ] * } * Sample code for parsing the JSON response... * Use the following online tool to generate parsing code from sample JSON: * Generate Parsing Code from JSON lcOdata_context = loJResp.StringOf('"@odata.context"') lnOdata_count = loJResp.IntOf('"@odata.count"') i = 0 lnCount_i = loJResp.SizeOfArray("value") DO WHILE i < lnCount_i loJResp.I = i lcOdata_type = loJResp.StringOf('value[i]."@odata.type"') lcId = loJResp.StringOf("value[i].id") lcDisplayName = loJResp.StringOf("value[i].displayName") lcUserId = loJResp.StringOf("value[i].userId") lcEmail = loJResp.StringOf("value[i].email") j = 0 lnCount_j = loJResp.SizeOfArray("value[i].roles") DO WHILE j < lnCount_j loJResp.J = j lcStrVal = loJResp.StringOf("value[i].roles[j]") j = j + 1 ENDDO i = i + 1 ENDDO RELEASE loHttp RELEASE loSbResponseBody RELEASE loJResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.