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

Tcl 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

 

 

 

(Tcl) Bluzone Get Project Details

Get a project by its id

For more information, see https://bluzone.io/portal/static/docs/index.html#_getprojectbyprojectid

Chilkat Tcl Extension Downloads

Chilkat Tcl Extension Downloads

load ./chilkat.dll

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

set http [new_CkHttp]

# Implements the following CURL command:

# curl -X GET \
#   https://bluzone.io/portal/papis/v1/projects/YOUR_PROJECT_ID_HERE/ \
#   -H 'bzid: YOUR_API_KEY_HERE'

CkHttp_SetRequestHeader $http "bzid" "YOUR_API_KEY_HERE"

set sbResponseBody [new_CkStringBuilder]

set success [CkHttp_QuickGetSb $http "https://bluzone.io/portal/papis/v1/projects/YOUR_PROJECT_ID_HERE/" $sbResponseBody]
if {[expr $success == 0]} then {
    puts [CkHttp_lastErrorText $http]
    delete_CkHttp $http
    delete_CkStringBuilder $sbResponseBody
    exit
}

set jResp [new_CkJsonObject]

CkJsonObject_LoadSb $jResp $sbResponseBody
CkJsonObject_put_EmitCompact $jResp 0

puts "Response Body:"
puts [CkJsonObject_emit $jResp]

set respStatusCode [CkHttp_get_LastStatus $http]
puts "Response Status Code = $respStatusCode"
if {[expr $respStatusCode >= 400]} then {
    puts "Response Header:"
    puts [CkHttp_lastHeader $http]
    puts "Failed."
    delete_CkHttp $http
    delete_CkStringBuilder $sbResponseBody
    delete_CkJsonObject $jResp
    exit
}

# Sample JSON response:

# {
#   "projectId": 36845,
#   "name": "My Project",
#   "description": "Default Project for admin@chilkatsoft.com, created on Thu Jun 06 17:18:11 GMT 2019.",
#   "status": null,
#   "owner": {
#     "username": "admin@chilkatsoft.com",
#     "emailAddress": null
#   },
#   "defaultUuidValue": "1b4b243c-59aa-405f-90b5-0c434cac1345",
#   "enableLocusMaps": false,
#   "mapProviderType": "GOOGLE",
#   "enableAdvancedPackets": false,
#   "enabledPacketTypes": "sBv2",
#   "enableDataUnload": false,
#   "enableScanConsumer": false,
#   "enablePolicyConsumer": false,
#   "enableLocationConsumer": false,
#   "enableEmail": true,
#   "firmwareUpdateStrategy": "MANUAL",
#   "deviceJobConcurrency": -1,
#   "mapProviderApiKey": null,
#   "wakeupUuid": null,
#   "reportEmailList": [
#   ],
#   "reportTimezone": "Etc/GMT",
#   "language": "en",
#   "blufiHostnameNaming": "DEFAULT",
#   "dateCreated": 1559841491000,
#   "dateUpdated": 1559841491000,
#   "enableStreamProducer": true,
#   "enableMetricStorage": true
# }

# Sample code for parsing the JSON response...
# Use the following online tool to generate parsing code from sample JSON:
# Generate Parsing Code from JSON

set projectId [CkJsonObject_IntOf $jResp "projectId"]
set name [CkJsonObject_stringOf $jResp "name"]
set description [CkJsonObject_stringOf $jResp "description"]
set status [CkJsonObject_stringOf $jResp "status"]
set ownerUsername [CkJsonObject_stringOf $jResp "owner.username"]
set ownerEmailAddress [CkJsonObject_stringOf $jResp "owner.emailAddress"]
set defaultUuidValue [CkJsonObject_stringOf $jResp "defaultUuidValue"]
set enableLocusMaps [CkJsonObject_BoolOf $jResp "enableLocusMaps"]
set mapProviderType [CkJsonObject_stringOf $jResp "mapProviderType"]
set enableAdvancedPackets [CkJsonObject_BoolOf $jResp "enableAdvancedPackets"]
set enabledPacketTypes [CkJsonObject_stringOf $jResp "enabledPacketTypes"]
set enableDataUnload [CkJsonObject_BoolOf $jResp "enableDataUnload"]
set enableScanConsumer [CkJsonObject_BoolOf $jResp "enableScanConsumer"]
set enablePolicyConsumer [CkJsonObject_BoolOf $jResp "enablePolicyConsumer"]
set enableLocationConsumer [CkJsonObject_BoolOf $jResp "enableLocationConsumer"]
set enableEmail [CkJsonObject_BoolOf $jResp "enableEmail"]
set firmwareUpdateStrategy [CkJsonObject_stringOf $jResp "firmwareUpdateStrategy"]
set deviceJobConcurrency [CkJsonObject_IntOf $jResp "deviceJobConcurrency"]
set mapProviderApiKey [CkJsonObject_stringOf $jResp "mapProviderApiKey"]
set wakeupUuid [CkJsonObject_stringOf $jResp "wakeupUuid"]
set reportTimezone [CkJsonObject_stringOf $jResp "reportTimezone"]
set language [CkJsonObject_stringOf $jResp "language"]
set blufiHostnameNaming [CkJsonObject_stringOf $jResp "blufiHostnameNaming"]
set dateCreated [CkJsonObject_IntOf $jResp "dateCreated"]
set dateUpdated [CkJsonObject_IntOf $jResp "dateUpdated"]
set enableStreamProducer [CkJsonObject_BoolOf $jResp "enableStreamProducer"]
set enableMetricStorage [CkJsonObject_BoolOf $jResp "enableMetricStorage"]
set i 0
set count_i [CkJsonObject_SizeOfArray $jResp "reportEmailList"]
while {[expr $i < $count_i]} {
    CkJsonObject_put_I $jResp $i
    set i [expr $i + 1]
}

delete_CkHttp $http
delete_CkStringBuilder $sbResponseBody
delete_CkJsonObject $jResp

 

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