Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Lianja Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
JCC Cyprus
Jira
Lightspeed
MYOB
Magento
Mailgun
Malaysia MyInvois

Mastercard
MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
Salesforce
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
TikTok Shop
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(Lianja) Trello Create New Board

Create a new board.

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

Chilkat Lianja Extension Download

Chilkat Lianja Extension

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

// curl --request POST \
//   --url 'https://api.trello.com/1/boards?name=name&defaultLabels=true&defaultLists=true&keepFromSource=none&prefs_permissionLevel=private
//           &prefs_voting=disabled&prefs_comments=members&prefs_invitations=members&prefs_selfJoin=true&prefs_cardCovers=true&prefs_background=blue&prefs_cardAging=regular'

// 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("name","Football & Rugby")
loRest.AddQueryParam("defaultLabels","true")
loRest.AddQueryParam("defaultLists","true")
loRest.AddQueryParam("keepFromSource","none")
loRest.AddQueryParam("prefs_permissionLevel","private")
loRest.AddQueryParam("prefs_voting","disabled")
loRest.AddQueryParam("prefs_comments","members")
loRest.AddQueryParam("prefs_invitations","members")
loRest.AddQueryParam("prefs_selfJoin","true")
loRest.AddQueryParam("prefs_cardCovers","true")
loRest.AddQueryParam("prefs_background","blue")
loRest.AddQueryParam("prefs_cardAging","regular")

loRest.AddHeader("Accept","application/json")

lcResponseBody = loRest.FullRequestFormUrlEncoded("POST","/1/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

loJson = createobject("CkJsonObject")
loJson.Load(lcResponseBody)
loJson.EmitCompact = .F.
? loJson.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

// 
// {
//   "id": "5cc606a1e2441a8a8fe3dc48",
//   "name": "Football",
//   "desc": "",
//   "descData": null,
//   "closed": false,
//   "idOrganization": null,
//   "pinned": false,
//   "url": "https://trello.com/b/eadpS1Pe/football",
//   "shortUrl": "https://trello.com/b/eadpS1Pe",
//   "prefs": {
//     "permissionLevel": "private",
//     "voting": "disabled",
//     "comments": "members",
//     "invitations": "members",
//     "selfJoin": true,
//     "cardCovers": true,
//     "cardAging": "regular",
//     "calendarFeedEnabled": false,
//     "background": "blue",
//     "backgroundImage": null,
//     "backgroundImageScaled": null,
//     "backgroundTile": false,
//     "backgroundBrightness": "dark",
//     "backgroundColor": "#0079BF",
//     "backgroundBottomColor": "#0079BF",
//     "backgroundTopColor": "#0079BF",
//     "canBePublic": true,
//     "canBeEnterprise": true,
//     "canBeOrg": true,
//     "canBePrivate": true,
//     "canInvite": true
//   },
//   "labelNames": {
//     "green": "",
//     "yellow": "",
//     "orange": "",
//     "red": "",
//     "purple": "",
//     "blue": "",
//     "sky": "",
//     "lime": "",
//     "pink": "",
//     "black": ""
//   },
//   "limits": {}
// }

lcId = loJson.StringOf("id")
lcName = loJson.StringOf("name")
lcDesc = loJson.StringOf("desc")
lcDescData = loJson.StringOf("descData")
llClosed = loJson.BoolOf("closed")
lcIdOrganization = loJson.StringOf("idOrganization")
llPinned = loJson.BoolOf("pinned")
lcUrl = loJson.StringOf("url")
lcShortUrl = loJson.StringOf("shortUrl")
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")
lcPrefsBackgroundImageScaled = loJson.StringOf("prefs.backgroundImageScaled")
llPrefsBackgroundTile = loJson.BoolOf("prefs.backgroundTile")
lcPrefsBackgroundBrightness = loJson.StringOf("prefs.backgroundBrightness")
lcPrefsBackgroundColor = loJson.StringOf("prefs.backgroundColor")
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")
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")


release loJsonToken
release loOauth1
release loRest
release loJson

 

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