Sample code for 30+ languages & platforms
AutoIt

Bluzone Get Project Details

See more Bluzone Examples

Get a project by its id

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

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

$oHttp = ObjCreate("Chilkat.Http")

; 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