Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

DataFlex Web API Examples

Primary Categories

AWS Translate
Activix CRM
Adyen
Amazon MWS
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bluzone
CardConnect
ClickBank
Clickatell
Cloudfare
DocuSign
ETrade
Etsy
Facebook
GeoOp
GetHarvest
Jira
MYOB

Magento
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Okta OAuth/OIDC
OneLogin OIDC
PayPal
Peoplevox
Populi
QuickBooks
SOAP finkok.com
Shippo
Shopify
Stripe
SugarCRM
Trello
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
Xero
eBay
effectconnect

 

 

 

(DataFlex) Trello List Member Boards

Lists the boards that the user is a member of.

For more information, see https://developers.trello.com/reference#membersidboards

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoJsonToken
    Boolean iSuccess
    Variant vOauth1
    Handle hoOauth1
    Handle hoRest
    Boolean iBAutoReconnect
    String sResponseBody
    Handle hoJarr
    Integer i
    Integer iCount_i
    Variant vJson
    Handle hoJson
    String sName
    String sDesc
    String sDescData
    Boolean iClosed
    String sIdOrganization
    String sLimits
    String sPinned
    String sShortLink
    String sDateLastActivity
    String sDatePluginDisable
    String sCreationMethod
    String sIxUpdate
    String sId
    Boolean iStarred
    String sUrl
    String sPrefsPermissionLevel
    String sPrefsVoting
    String sPrefsComments
    String sPrefsInvitations
    Boolean iPrefsSelfJoin
    Boolean iPrefsCardCovers
    String sPrefsCardAging
    Boolean iPrefsCalendarFeedEnabled
    String sPrefsBackground
    String sPrefsBackgroundImage
    Boolean iPrefsBackgroundTile
    String sPrefsBackgroundBrightness
    String sPrefsBackgroundBottomColor
    String sPrefsBackgroundTopColor
    Boolean iPrefsCanBePublic
    Boolean iPrefsCanBeEnterprise
    Boolean iPrefsCanBeOrg
    Boolean iPrefsCanBePrivate
    Boolean iPrefsCanInvite
    Boolean iSubscribed
    String sLabelNamesGreen
    String sLabelNamesYellow
    String sLabelNamesOrange
    String sLabelNamesRed
    String sLabelNamesPurple
    String sLabelNamesBlue
    String sLabelNamesSky
    String sLabelNamesLime
    String sLabelNamesPink
    String sLabelNamesBlack
    String sDateLastView
    String sShortUrl
    String sPrefsBackgroundImageScaled
    String sPrefsBackgroundColor
    Integer j
    Integer iCount_j
    Integer iWidth
    Integer iHeight
    String sIdMember
    String sMemberType
    Boolean iUnconfirmed
    Boolean iDeactivated
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

    // 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.
    Get Create (RefClass(cComChilkatJsonObject)) To hoJsonToken
    If (Not(IsComObjectCreated(hoJsonToken))) Begin
        Send CreateComObject of hoJsonToken
    End
    Get ComLoadFile Of hoJsonToken "qa_data/tokens/trello.json" To iSuccess

    Get Create (RefClass(cComChilkatOAuth1)) To hoOauth1
    If (Not(IsComObjectCreated(hoOauth1))) Begin
        Send CreateComObject of hoOauth1
    End
    Set ComConsumerKey Of hoOauth1 To "TRELLO_CONSUMER_KEY"
    Set ComConsumerSecret Of hoOauth1 To "TRELLO_CONSUMER_SECRET"
    Get ComStringOf Of hoJsonToken "oauth_token" To sTemp1
    Set ComToken Of hoOauth1 To sTemp1
    Get ComStringOf Of hoJsonToken "oauth_token_secret" To sTemp1
    Set ComTokenSecret Of hoOauth1 To sTemp1

    Get Create (RefClass(cComChilkatRest)) To hoRest
    If (Not(IsComObjectCreated(hoRest))) Begin
        Send CreateComObject of hoRest
    End

    // 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.
    Move True To iBAutoReconnect
    Get ComConnect Of hoRest "api.trello.com" 443 True iBAutoReconnect To iSuccess
    If (iSuccess <> True) Begin
        Get ComLastErrorText Of hoRest To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get pvComObject of hoOauth1 to vOauth1
    Get ComSetAuthOAuth1 Of hoRest vOauth1 False To iSuccess

    Get ComAddQueryParam Of hoRest "filter" "all" To iSuccess
    Get ComAddQueryParam Of hoRest "fields" "all" To iSuccess
    Get ComAddQueryParam Of hoRest "lists" "none" To iSuccess
    Get ComAddQueryParam Of hoRest "memberships" "normal" To iSuccess
    Get ComAddQueryParam Of hoRest "organization" "false" To iSuccess
    Get ComAddQueryParam Of hoRest "organization_fields" "name,displayName" To iSuccess

    Get ComAddHeader Of hoRest "Accept" "application/json" To iSuccess

    Get ComFullRequestNoBody Of hoRest "GET" "/1/members/member_id/boards" To sResponseBody
    Get ComLastMethodSuccess Of hoRest To bTemp1
    If (bTemp1 <> True) Begin
        Get ComLastErrorText Of hoRest To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    // We should expect a 200 response if successful.
    Get ComResponseStatusCode Of hoRest To iTemp1
    If (iTemp1 <> 200) Begin
        Showln "Request Header: "
        Get ComLastRequestHeader Of hoRest To sTemp1
        Showln sTemp1
        Showln "----"
        Get ComResponseStatusCode Of hoRest To iTemp1
        Showln "Response StatusCode = " iTemp1
        Get ComResponseStatusText Of hoRest To sTemp1
        Showln "Response StatusLine: " sTemp1
        Showln "Response Header:"
        Get ComResponseHeader Of hoRest To sTemp1
        Showln sTemp1
        Showln sResponseBody
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatJsonArray)) To hoJarr
    If (Not(IsComObjectCreated(hoJarr))) Begin
        Send CreateComObject of hoJarr
    End
    Get ComLoad Of hoJarr sResponseBody To iSuccess
    Set ComEmitCompact Of hoJarr To False
    Get ComEmit Of hoJarr To sTemp1
    Showln sTemp1
    Showln "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
    //       }
    //     ]
    //   }
    // ]

    Move 0 To i
    Get ComSize Of hoJarr To iCount_i
    While (i < iCount_i)
        Get ComObjectAt Of hoJarr i To vJson
        If (IsComObject(vJson)) Begin
            Get Create (RefClass(cComChilkatJsonObject)) To hoJson
            Set pvComObject Of hoJson To vJson
        End
        Get ComStringOf Of hoJson "name" To sName
        Get ComStringOf Of hoJson "desc" To sDesc
        Get ComStringOf Of hoJson "descData" To sDescData
        Get ComBoolOf Of hoJson "closed" To iClosed
        Get ComStringOf Of hoJson "idOrganization" To sIdOrganization
        Get ComStringOf Of hoJson "limits" To sLimits
        Get ComStringOf Of hoJson "pinned" To sPinned
        Get ComStringOf Of hoJson "shortLink" To sShortLink
        Get ComStringOf Of hoJson "dateLastActivity" To sDateLastActivity
        Get ComStringOf Of hoJson "datePluginDisable" To sDatePluginDisable
        Get ComStringOf Of hoJson "creationMethod" To sCreationMethod
        Get ComStringOf Of hoJson "ixUpdate" To sIxUpdate
        Get ComStringOf Of hoJson "id" To sId
        Get ComBoolOf Of hoJson "starred" To iStarred
        Get ComStringOf Of hoJson "url" To sUrl
        Get ComStringOf Of hoJson "prefs.permissionLevel" To sPrefsPermissionLevel
        Get ComStringOf Of hoJson "prefs.voting" To sPrefsVoting
        Get ComStringOf Of hoJson "prefs.comments" To sPrefsComments
        Get ComStringOf Of hoJson "prefs.invitations" To sPrefsInvitations
        Get ComBoolOf Of hoJson "prefs.selfJoin" To iPrefsSelfJoin
        Get ComBoolOf Of hoJson "prefs.cardCovers" To iPrefsCardCovers
        Get ComStringOf Of hoJson "prefs.cardAging" To sPrefsCardAging
        Get ComBoolOf Of hoJson "prefs.calendarFeedEnabled" To iPrefsCalendarFeedEnabled
        Get ComStringOf Of hoJson "prefs.background" To sPrefsBackground
        Get ComStringOf Of hoJson "prefs.backgroundImage" To sPrefsBackgroundImage
        Get ComBoolOf Of hoJson "prefs.backgroundTile" To iPrefsBackgroundTile
        Get ComStringOf Of hoJson "prefs.backgroundBrightness" To sPrefsBackgroundBrightness
        Get ComStringOf Of hoJson "prefs.backgroundBottomColor" To sPrefsBackgroundBottomColor
        Get ComStringOf Of hoJson "prefs.backgroundTopColor" To sPrefsBackgroundTopColor
        Get ComBoolOf Of hoJson "prefs.canBePublic" To iPrefsCanBePublic
        Get ComBoolOf Of hoJson "prefs.canBeEnterprise" To iPrefsCanBeEnterprise
        Get ComBoolOf Of hoJson "prefs.canBeOrg" To iPrefsCanBeOrg
        Get ComBoolOf Of hoJson "prefs.canBePrivate" To iPrefsCanBePrivate
        Get ComBoolOf Of hoJson "prefs.canInvite" To iPrefsCanInvite
        Get ComBoolOf Of hoJson "subscribed" To iSubscribed
        Get ComStringOf Of hoJson "labelNames.green" To sLabelNamesGreen
        Get ComStringOf Of hoJson "labelNames.yellow" To sLabelNamesYellow
        Get ComStringOf Of hoJson "labelNames.orange" To sLabelNamesOrange
        Get ComStringOf Of hoJson "labelNames.red" To sLabelNamesRed
        Get ComStringOf Of hoJson "labelNames.purple" To sLabelNamesPurple
        Get ComStringOf Of hoJson "labelNames.blue" To sLabelNamesBlue
        Get ComStringOf Of hoJson "labelNames.sky" To sLabelNamesSky
        Get ComStringOf Of hoJson "labelNames.lime" To sLabelNamesLime
        Get ComStringOf Of hoJson "labelNames.pink" To sLabelNamesPink
        Get ComStringOf Of hoJson "labelNames.black" To sLabelNamesBlack
        Get ComStringOf Of hoJson "dateLastView" To sDateLastView
        Get ComStringOf Of hoJson "shortUrl" To sShortUrl
        Get ComStringOf Of hoJson "prefs.backgroundImageScaled" To sPrefsBackgroundImageScaled
        Get ComStringOf Of hoJson "prefs.backgroundColor" To sPrefsBackgroundColor
        Move 0 To j
        Get ComSizeOfArray Of hoJson "powerUps" To iCount_j
        While (j < iCount_j)
            Set ComJ Of hoJson To j
            // ...
            Move j + 1 To j
        Loop

        Move 0 To j
        Get ComSizeOfArray Of hoJson "idTags" To iCount_j
        While (j < iCount_j)
            Set ComJ Of hoJson To j
            // ...
            Move j + 1 To j
        Loop

        Move 0 To j
        Get ComSizeOfArray Of hoJson "prefs.backgroundImageScaled" To iCount_j
        While (j < iCount_j)
            Set ComJ Of hoJson To j
            Get ComIntOf Of hoJson "prefs.backgroundImageScaled[j].width" To iWidth
            Get ComIntOf Of hoJson "prefs.backgroundImageScaled[j].height" To iHeight
            Get ComStringOf Of hoJson "prefs.backgroundImageScaled[j].url" To sUrl
            Move j + 1 To j
        Loop

        Move 0 To j
        Get ComSizeOfArray Of hoJson "memberships" To iCount_j
        While (j < iCount_j)
            Set ComJ Of hoJson To j
            Get ComStringOf Of hoJson "memberships[j].id" To sId
            Get ComStringOf Of hoJson "memberships[j].idMember" To sIdMember
            Get ComStringOf Of hoJson "memberships[j].memberType" To sMemberType
            Get ComBoolOf Of hoJson "memberships[j].unconfirmed" To iUnconfirmed
            Get ComBoolOf Of hoJson "memberships[j].deactivated" To iDeactivated
            Move j + 1 To j
        Loop

        Send Destroy of hoJson
        Move i + 1 To i
    Loop



End_Procedure

 

© 2000-2019 Chilkat Software, Inc. All Rights Reserved.