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
(AutoIt) Bluzone Get Project DetailsGet a project by its id For more information, see https://bluzone.io/portal/static/docs/index.html#_getprojectbyprojectid
; This example assumes the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oHttp = ObjCreate("Chilkat.Http") Local $bSuccess ; 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' $oHttp.SetRequestHeader "bzid","YOUR_API_KEY_HERE" $oSbResponseBody = ObjCreate("Chilkat.StringBuilder") $bSuccess = $oHttp.QuickGetSb("https://bluzone.io/portal/papis/v1/projects/YOUR_PROJECT_ID_HERE/",$oSbResponseBody) If ($bSuccess = False) Then ConsoleWrite($oHttp.LastErrorText & @CRLF) Exit EndIf $oJResp = ObjCreate("Chilkat.JsonObject") $oJResp.LoadSb($oSbResponseBody) $oJResp.EmitCompact = False ConsoleWrite("Response Body:" & @CRLF) ConsoleWrite($oJResp.Emit() & @CRLF) Local $iRespStatusCode = $oHttp.LastStatus ConsoleWrite("Response Status Code = " & $iRespStatusCode & @CRLF) If ($iRespStatusCode >= 400) Then ConsoleWrite("Response Header:" & @CRLF) ConsoleWrite($oHttp.LastHeader & @CRLF) ConsoleWrite("Failed." & @CRLF) Exit EndIf ; 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 Local $iProjectId Local $sName Local $sDescription Local $status Local $sOwnerUsername Local $sOwnerEmailAddress Local $sDefaultUuidValue Local $bEnableLocusMaps Local $sMapProviderType Local $bEnableAdvancedPackets Local $sEnabledPacketTypes Local $bEnableDataUnload Local $bEnableScanConsumer Local $bEnablePolicyConsumer Local $bEnableLocationConsumer Local $bEnableEmail Local $sFirmwareUpdateStrategy Local $iDeviceJobConcurrency Local $sMapProviderApiKey Local $sWakeupUuid Local $sReportTimezone Local $sLanguage Local $sBlufiHostnameNaming Local $iDateCreated Local $iDateUpdated Local $bEnableStreamProducer Local $bEnableMetricStorage Local $i Local $iCount_i $iProjectId = $oJResp.IntOf("projectId") $sName = $oJResp.StringOf("name") $sDescription = $oJResp.StringOf("description") $status = $oJResp.StringOf("status") $sOwnerUsername = $oJResp.StringOf("owner.username") $sOwnerEmailAddress = $oJResp.StringOf("owner.emailAddress") $sDefaultUuidValue = $oJResp.StringOf("defaultUuidValue") $bEnableLocusMaps = $oJResp.BoolOf("enableLocusMaps") $sMapProviderType = $oJResp.StringOf("mapProviderType") $bEnableAdvancedPackets = $oJResp.BoolOf("enableAdvancedPackets") $sEnabledPacketTypes = $oJResp.StringOf("enabledPacketTypes") $bEnableDataUnload = $oJResp.BoolOf("enableDataUnload") $bEnableScanConsumer = $oJResp.BoolOf("enableScanConsumer") $bEnablePolicyConsumer = $oJResp.BoolOf("enablePolicyConsumer") $bEnableLocationConsumer = $oJResp.BoolOf("enableLocationConsumer") $bEnableEmail = $oJResp.BoolOf("enableEmail") $sFirmwareUpdateStrategy = $oJResp.StringOf("firmwareUpdateStrategy") $iDeviceJobConcurrency = $oJResp.IntOf("deviceJobConcurrency") $sMapProviderApiKey = $oJResp.StringOf("mapProviderApiKey") $sWakeupUuid = $oJResp.StringOf("wakeupUuid") $sReportTimezone = $oJResp.StringOf("reportTimezone") $sLanguage = $oJResp.StringOf("language") $sBlufiHostnameNaming = $oJResp.StringOf("blufiHostnameNaming") $iDateCreated = $oJResp.IntOf("dateCreated") $iDateUpdated = $oJResp.IntOf("dateUpdated") $bEnableStreamProducer = $oJResp.BoolOf("enableStreamProducer") $bEnableMetricStorage = $oJResp.BoolOf("enableMetricStorage") $i = 0 $iCount_i = $oJResp.SizeOfArray("reportEmailList") While $i < $iCount_i $oJResp.I = $i $i = $i + 1 Wend |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.