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
(Lianja) 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. loJsonToken = createobject("CkJsonObject") llSuccess = loJsonToken.LoadFile("qa_data/tokens/trello.json") loOauth1 = createobject("CkOAuth1") loOauth1.ConsumerKey = "TRELLO_CONSUMER_KEY" loOauth1.ConsumerSecret = "TRELLO_CONSUMER_SECRET" loOauth1.Token = loJsonToken.StringOf("oauth_token") loOauth1.TokenSecret = loJsonToken.StringOf("oauth_token_secret") loRest = createobject("CkRest") // 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. llBAutoReconnect = .T. llSuccess = loRest.Connect("api.trello.com",443,.T.,llBAutoReconnect) if (llSuccess <> .T.) then ? loRest.LastErrorText release loJsonToken release loOauth1 release loRest return endif loRest.SetAuthOAuth1(loOauth1,.F.) loRest.AddQueryParam("filter","all") loRest.AddQueryParam("fields","all") loRest.AddQueryParam("lists","none") loRest.AddQueryParam("memberships","normal") loRest.AddQueryParam("organization","false") loRest.AddQueryParam("organization_fields","name,displayName") loRest.AddHeader("Accept","application/json") lcResponseBody = loRest.FullRequestNoBody("GET","/1/members/member_id/boards") if (loRest.LastMethodSuccess <> .T.) then ? loRest.LastErrorText release loJsonToken release loOauth1 release loRest return endif // We should expect a 200 response if successful. if (loRest.ResponseStatusCode <> 200) then ? "Request Header: " ? loRest.LastRequestHeader ? "----" ? "Response StatusCode = " + str(loRest.ResponseStatusCode) ? "Response StatusLine: " + loRest.ResponseStatusText ? "Response Header:" ? loRest.ResponseHeader ? lcResponseBody release loJsonToken release loOauth1 release loRest return endif loJarr = createobject("CkJsonArray") loJarr.Load(lcResponseBody) loJarr.EmitCompact = .F. ? loJarr.Emit() ? "Success." // 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 // } // ] // } // ] i = 0 lnCount_i = loJarr.Size do while i < lnCount_i loJson = loJarr.ObjectAt(i) lcName = loJson.StringOf("name") lcDesc = loJson.StringOf("desc") lcDescData = loJson.StringOf("descData") llClosed = loJson.BoolOf("closed") lcIdOrganization = loJson.StringOf("idOrganization") lcLimits = loJson.StringOf("limits") lcPinned = loJson.StringOf("pinned") lcShortLink = loJson.StringOf("shortLink") lcDateLastActivity = loJson.StringOf("dateLastActivity") lcDatePluginDisable = loJson.StringOf("datePluginDisable") lcCreationMethod = loJson.StringOf("creationMethod") lcIxUpdate = loJson.StringOf("ixUpdate") lcId = loJson.StringOf("id") llStarred = loJson.BoolOf("starred") lcUrl = loJson.StringOf("url") lcPrefsPermissionLevel = loJson.StringOf("prefs.permissionLevel") lcPrefsVoting = loJson.StringOf("prefs.voting") lcPrefsComments = loJson.StringOf("prefs.comments") lcPrefsInvitations = loJson.StringOf("prefs.invitations") llPrefsSelfJoin = loJson.BoolOf("prefs.selfJoin") llPrefsCardCovers = loJson.BoolOf("prefs.cardCovers") lcPrefsCardAging = loJson.StringOf("prefs.cardAging") llPrefsCalendarFeedEnabled = loJson.BoolOf("prefs.calendarFeedEnabled") lcPrefsBackground = loJson.StringOf("prefs.background") lcPrefsBackgroundImage = loJson.StringOf("prefs.backgroundImage") llPrefsBackgroundTile = loJson.BoolOf("prefs.backgroundTile") lcPrefsBackgroundBrightness = loJson.StringOf("prefs.backgroundBrightness") lcPrefsBackgroundBottomColor = loJson.StringOf("prefs.backgroundBottomColor") lcPrefsBackgroundTopColor = loJson.StringOf("prefs.backgroundTopColor") llPrefsCanBePublic = loJson.BoolOf("prefs.canBePublic") llPrefsCanBeEnterprise = loJson.BoolOf("prefs.canBeEnterprise") llPrefsCanBeOrg = loJson.BoolOf("prefs.canBeOrg") llPrefsCanBePrivate = loJson.BoolOf("prefs.canBePrivate") llPrefsCanInvite = loJson.BoolOf("prefs.canInvite") llSubscribed = loJson.BoolOf("subscribed") lcLabelNamesGreen = loJson.StringOf("labelNames.green") lcLabelNamesYellow = loJson.StringOf("labelNames.yellow") lcLabelNamesOrange = loJson.StringOf("labelNames.orange") lcLabelNamesRed = loJson.StringOf("labelNames.red") lcLabelNamesPurple = loJson.StringOf("labelNames.purple") lcLabelNamesBlue = loJson.StringOf("labelNames.blue") lcLabelNamesSky = loJson.StringOf("labelNames.sky") lcLabelNamesLime = loJson.StringOf("labelNames.lime") lcLabelNamesPink = loJson.StringOf("labelNames.pink") lcLabelNamesBlack = loJson.StringOf("labelNames.black") lcDateLastView = loJson.StringOf("dateLastView") lcShortUrl = loJson.StringOf("shortUrl") lcPrefsBackgroundImageScaled = loJson.StringOf("prefs.backgroundImageScaled") lcPrefsBackgroundColor = loJson.StringOf("prefs.backgroundColor") j = 0 lnCount_j = loJson.SizeOfArray("powerUps") do while j < lnCount_j loJson.J = j // ... j = j + 1 enddo j = 0 lnCount_j = loJson.SizeOfArray("idTags") do while j < lnCount_j loJson.J = j // ... j = j + 1 enddo j = 0 lnCount_j = loJson.SizeOfArray("prefs.backgroundImageScaled") do while j < lnCount_j loJson.J = j lnWidth = loJson.IntOf("prefs.backgroundImageScaled[j].width") lnHeight = loJson.IntOf("prefs.backgroundImageScaled[j].height") lcUrl = loJson.StringOf("prefs.backgroundImageScaled[j].url") j = j + 1 enddo j = 0 lnCount_j = loJson.SizeOfArray("memberships") do while j < lnCount_j loJson.J = j lcId = loJson.StringOf("memberships[j].id") lcIdMember = loJson.StringOf("memberships[j].idMember") lcMemberType = loJson.StringOf("memberships[j].memberType") llUnconfirmed = loJson.BoolOf("memberships[j].unconfirmed") llDeactivated = loJson.BoolOf("memberships[j].deactivated") j = j + 1 enddo release loJson i = i + 1 enddo release loJsonToken release loOauth1 release loRest release loJarr |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.