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
(Tcl) Bluzone Get Project DetailsGet a project by its id For more information, see https://bluzone.io/portal/static/docs/index.html#_getprojectbyprojectid
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 {$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 {$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 {$i < $count_i} { CkJsonObject_put_I $jResp $i set i [expr $i + 1] } delete_CkHttp $http delete_CkStringBuilder $sbResponseBody delete_CkJsonObject $jResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.