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
(AutoIt) Trello List Member BoardsLists the boards that the user is a member of. For more information, see https://developers.trello.com/reference#membersidboards
; This example assumes the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. ; curl --request GET \ ; --url 'https://api.trello.com/1/members/{member_id}/boards?filter=all&fields=all&lists=none&memberships=none&organization=false&organization_fields=displayName' ; First get our previously obtained access token. $oJsonToken = ObjCreate("Chilkat.JsonObject") Local $bSuccess = $oJsonToken.LoadFile("qa_data/tokens/trello.json") $oOauth1 = ObjCreate("Chilkat.OAuth1") $oOauth1.ConsumerKey = "TRELLO_CONSUMER_KEY" $oOauth1.ConsumerSecret = "TRELLO_CONSUMER_SECRET" $oOauth1.Token = $oJsonToken.StringOf("oauth_token") $oOauth1.TokenSecret = $oJsonToken.StringOf("oauth_token_secret") $oRest = ObjCreate("Chilkat.Rest") ; Connect using TLS. ; A single REST object, once connected, can be used for many Trello REST API calls. ; The auto-reconnect indicates that if the already-established HTTPS connection is closed, ; then it will be automatically re-established as needed. Local $bAutoReconnect = True $bSuccess = $oRest.Connect("api.trello.com",443,True,$bAutoReconnect) If ($bSuccess <> True) Then ConsoleWrite($oRest.LastErrorText & @CRLF) Exit EndIf $oRest.SetAuthOAuth1($oOauth1,False) $oRest.AddQueryParam("filter","all") $oRest.AddQueryParam("fields","all") $oRest.AddQueryParam("lists","none") $oRest.AddQueryParam("memberships","normal") $oRest.AddQueryParam("organization","false") $oRest.AddQueryParam("organization_fields","name,displayName") $oRest.AddHeader("Accept","application/json") Local $sResponseBody = $oRest.FullRequestNoBody("GET","/1/members/member_id/boards") If ($oRest.LastMethodSuccess <> True) Then ConsoleWrite($oRest.LastErrorText & @CRLF) Exit EndIf ; We should expect a 200 response if successful. If ($oRest.ResponseStatusCode <> 200) Then ConsoleWrite("Request Header: " & @CRLF) ConsoleWrite($oRest.LastRequestHeader & @CRLF) ConsoleWrite("----" & @CRLF) ConsoleWrite("Response StatusCode = " & $oRest.ResponseStatusCode & @CRLF) ConsoleWrite("Response StatusLine: " & $oRest.ResponseStatusText & @CRLF) ConsoleWrite("Response Header:" & @CRLF) ConsoleWrite($oRest.ResponseHeader & @CRLF) ConsoleWrite($sResponseBody & @CRLF) Exit EndIf $oJarr = ObjCreate("Chilkat.JsonArray") $oJarr.Load($sResponseBody) $oJarr.EmitCompact = False ConsoleWrite($oJarr.Emit() & @CRLF) ConsoleWrite("Success." & @CRLF) ; A sample JSON response: ; (See the parsing code below...) ; Use this online tool to generate parsing code from sample JSON: ; Generate Parsing Code from JSON ; [ ; { ; "name": "House Projects", ; "desc": "", ; "descData": null, ; "closed": false, ; "idOrganization": null, ; "limits": null, ; "pinned": null, ; "shortLink": "j1hkQKKS", ; "powerUps": [ ; ], ; "dateLastActivity": null, ; "idTags": [ ; ], ; "datePluginDisable": null, ; "creationMethod": null, ; "ixUpdate": null, ; "id": "5cc5fe862106bb8e05aa41e7", ; "starred": false, ; "url": "https://trello.com/b/j1hkQKKS/house-projects", ; "prefs": { ; "permissionLevel": "private", ; "voting": "disabled", ; "comments": "members", ; "invitations": "members", ; "selfJoin": false, ; "cardCovers": true, ; "cardAging": "regular", ; "calendarFeedEnabled": false, ; "background": "5cc344f6ba4cdc5f5cfc7d81", ; "backgroundImage": "https://trello-backgrounds.s3.amazonaws.com/SharedBackground/2560x1709/4418c78f2f66d26932fef88aead2aff5/photo-1555985202-12975b0235dc", ; "backgroundImageScaled": [ ; { ; "width": 140, ; "height": 93, ; "url": "https://trello-backgrounds.s3.amazonaws.com/SharedBackground/140x93/0aebced0ac2d8c9c4b9231b1960d28c2/photo-1555985202-12975b0235dc.jpg" ; }, ; ... ; { ; "width": 2560, ; "height": 1709, ; "url": "https://trello-backgrounds.s3.amazonaws.com/SharedBackground/2560x1709/4418c78f2f66d26932fef88aead2aff5/photo-1555985202-12975b0235dc" ; } ; ], ; "backgroundTile": false, ; "backgroundBrightness": "dark", ; "backgroundBottomColor": "#412f23", ; "backgroundTopColor": "#a99d97", ; "canBePublic": true, ; "canBeEnterprise": true, ; "canBeOrg": true, ; "canBePrivate": true, ; "canInvite": true ; }, ; "subscribed": false, ; "labelNames": { ; "green": "", ; "yellow": "", ; "orange": "", ; "red": "", ; "purple": "", ; "blue": "", ; "sky": "", ; "lime": "", ; "pink": "", ; "black": "" ; }, ; "dateLastView": "2019-04-28T19:28:18.159Z", ; "shortUrl": "https://trello.com/b/j1hkQKKS", ; "memberships": [ ; { ; "id": "5cc5fe862106bb8e05aa41e8", ; "idMember": "5cc5c74067d5215921ca7677", ; "memberType": "admin", ; "unconfirmed": false, ; "deactivated": false ; } ; ] ; }, ; { ; "name": "Vacation Planning", ; "desc": "", ; "descData": null, ; "closed": false, ; "idOrganization": null, ; "limits": null, ; "pinned": null, ; "shortLink": "QqIHvQyz", ; "powerUps": [ ; ], ; "dateLastActivity": "2019-04-28T15:32:20.134Z", ; "idTags": [ ; ], ; "datePluginDisable": null, ; "creationMethod": "assisted", ; "ixUpdate": null, ; "id": "5cc5c783f5b10f8717a6b3d6", ; "starred": false, ; "url": "https://trello.com/b/QqIHvQyz/vacation-planning", ; "prefs": { ; "permissionLevel": "private", ; "voting": "disabled", ; "comments": "members", ; "invitations": "members", ; "selfJoin": true, ; "cardCovers": true, ; "cardAging": "regular", ; "calendarFeedEnabled": false, ; "background": "lime", ; "backgroundImage": null, ; "backgroundImageScaled": null, ; "backgroundTile": false, ; "backgroundBrightness": "dark", ; "backgroundColor": "#4BBF6B", ; "backgroundBottomColor": "#4BBF6B", ; "backgroundTopColor": "#4BBF6B", ; "canBePublic": true, ; "canBeEnterprise": true, ; "canBeOrg": true, ; "canBePrivate": true, ; "canInvite": true ; }, ; "subscribed": false, ; "labelNames": { ; "green": "", ; "yellow": "", ; "orange": "", ; "red": "", ; "purple": "", ; "blue": "", ; "sky": "", ; "lime": "", ; "pink": "", ; "black": "" ; }, ; "dateLastView": "2019-04-28T19:32:21.009Z", ; "shortUrl": "https://trello.com/b/QqIHvQyz", ; "memberships": [ ; { ; "id": "5cc5c783f5b10f8717a6b3d7", ; "idMember": "5cc5c74067d5215921ca7677", ; "memberType": "admin", ; "unconfirmed": false, ; "deactivated": false ; } ; ] ; } ; ] Local $i Local $iCount_i Local $oJson Local $sName Local $sDesc Local $sDescData Local $bClosed Local $sIdOrganization Local $sLimits Local $sPinned Local $shortLink Local $sDateLastActivity Local $sDatePluginDisable Local $sCreationMethod Local $sIxUpdate Local $sId Local $bStarred Local $sUrl Local $sPrefsPermissionLevel Local $sPrefsVoting Local $sPrefsComments Local $sPrefsInvitations Local $bPrefsSelfJoin Local $bPrefsCardCovers Local $sPrefsCardAging Local $bPrefsCalendarFeedEnabled Local $sPrefsBackground Local $sPrefsBackgroundImage Local $bPrefsBackgroundTile Local $sPrefsBackgroundBrightness Local $sPrefsBackgroundBottomColor Local $sPrefsBackgroundTopColor Local $bPrefsCanBePublic Local $bPrefsCanBeEnterprise Local $bPrefsCanBeOrg Local $bPrefsCanBePrivate Local $bPrefsCanInvite Local $bSubscribed Local $sLabelNamesGreen Local $sLabelNamesYellow Local $sLabelNamesOrange Local $sLabelNamesRed Local $sLabelNamesPurple Local $sLabelNamesBlue Local $sLabelNamesSky Local $sLabelNamesLime Local $sLabelNamesPink Local $sLabelNamesBlack Local $sDateLastView Local $shortUrl Local $sPrefsBackgroundImageScaled Local $sPrefsBackgroundColor Local $iJ Local $iCount_j Local $iWidth Local $iHeight Local $sIdMember Local $sMemberType Local $bUnconfirmed Local $bDeactivated $i = 0 $iCount_i = $oJarr.Size While $i < $iCount_i $oJson = $oJarr.ObjectAt($i) $sName = $oJson.StringOf("name") $sDesc = $oJson.StringOf("desc") $sDescData = $oJson.StringOf("descData") $bClosed = $oJson.BoolOf("closed") $sIdOrganization = $oJson.StringOf("idOrganization") $sLimits = $oJson.StringOf("limits") $sPinned = $oJson.StringOf("pinned") $shortLink = $oJson.StringOf("shortLink") $sDateLastActivity = $oJson.StringOf("dateLastActivity") $sDatePluginDisable = $oJson.StringOf("datePluginDisable") $sCreationMethod = $oJson.StringOf("creationMethod") $sIxUpdate = $oJson.StringOf("ixUpdate") $sId = $oJson.StringOf("id") $bStarred = $oJson.BoolOf("starred") $sUrl = $oJson.StringOf("url") $sPrefsPermissionLevel = $oJson.StringOf("prefs.permissionLevel") $sPrefsVoting = $oJson.StringOf("prefs.voting") $sPrefsComments = $oJson.StringOf("prefs.comments") $sPrefsInvitations = $oJson.StringOf("prefs.invitations") $bPrefsSelfJoin = $oJson.BoolOf("prefs.selfJoin") $bPrefsCardCovers = $oJson.BoolOf("prefs.cardCovers") $sPrefsCardAging = $oJson.StringOf("prefs.cardAging") $bPrefsCalendarFeedEnabled = $oJson.BoolOf("prefs.calendarFeedEnabled") $sPrefsBackground = $oJson.StringOf("prefs.background") $sPrefsBackgroundImage = $oJson.StringOf("prefs.backgroundImage") $bPrefsBackgroundTile = $oJson.BoolOf("prefs.backgroundTile") $sPrefsBackgroundBrightness = $oJson.StringOf("prefs.backgroundBrightness") $sPrefsBackgroundBottomColor = $oJson.StringOf("prefs.backgroundBottomColor") $sPrefsBackgroundTopColor = $oJson.StringOf("prefs.backgroundTopColor") $bPrefsCanBePublic = $oJson.BoolOf("prefs.canBePublic") $bPrefsCanBeEnterprise = $oJson.BoolOf("prefs.canBeEnterprise") $bPrefsCanBeOrg = $oJson.BoolOf("prefs.canBeOrg") $bPrefsCanBePrivate = $oJson.BoolOf("prefs.canBePrivate") $bPrefsCanInvite = $oJson.BoolOf("prefs.canInvite") $bSubscribed = $oJson.BoolOf("subscribed") $sLabelNamesGreen = $oJson.StringOf("labelNames.green") $sLabelNamesYellow = $oJson.StringOf("labelNames.yellow") $sLabelNamesOrange = $oJson.StringOf("labelNames.orange") $sLabelNamesRed = $oJson.StringOf("labelNames.red") $sLabelNamesPurple = $oJson.StringOf("labelNames.purple") $sLabelNamesBlue = $oJson.StringOf("labelNames.blue") $sLabelNamesSky = $oJson.StringOf("labelNames.sky") $sLabelNamesLime = $oJson.StringOf("labelNames.lime") $sLabelNamesPink = $oJson.StringOf("labelNames.pink") $sLabelNamesBlack = $oJson.StringOf("labelNames.black") $sDateLastView = $oJson.StringOf("dateLastView") $shortUrl = $oJson.StringOf("shortUrl") $sPrefsBackgroundImageScaled = $oJson.StringOf("prefs.backgroundImageScaled") $sPrefsBackgroundColor = $oJson.StringOf("prefs.backgroundColor") $iJ = 0 $iCount_j = $oJson.SizeOfArray("powerUps") While $iJ < $iCount_j $oJson.J = $iJ ; ... $iJ = $iJ + 1 Wend $iJ = 0 $iCount_j = $oJson.SizeOfArray("idTags") While $iJ < $iCount_j $oJson.J = $iJ ; ... $iJ = $iJ + 1 Wend $iJ = 0 $iCount_j = $oJson.SizeOfArray("prefs.backgroundImageScaled") While $iJ < $iCount_j $oJson.J = $iJ $iWidth = $oJson.IntOf("prefs.backgroundImageScaled[j].width") $iHeight = $oJson.IntOf("prefs.backgroundImageScaled[j].height") $sUrl = $oJson.StringOf("prefs.backgroundImageScaled[j].url") $iJ = $iJ + 1 Wend $iJ = 0 $iCount_j = $oJson.SizeOfArray("memberships") While $iJ < $iCount_j $oJson.J = $iJ $sId = $oJson.StringOf("memberships[j].id") $sIdMember = $oJson.StringOf("memberships[j].idMember") $sMemberType = $oJson.StringOf("memberships[j].memberType") $bUnconfirmed = $oJson.BoolOf("memberships[j].unconfirmed") $bDeactivated = $oJson.BoolOf("memberships[j].deactivated") $iJ = $iJ + 1 Wend $i = $i + 1 Wend |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.