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
(PowerBuilder) Bluzone Get Project DetailsGet a project by its id For more information, see https://bluzone.io/portal/static/docs/index.html#_getprojectbyprojectid
integer li_rc oleobject loo_Http integer li_Success oleobject loo_SbResponseBody oleobject loo_JResp integer li_RespStatusCode integer li_ProjectId string ls_Name string ls_Description string ls_Status string ls_OwnerUsername string ls_OwnerEmailAddress string ls_DefaultUuidValue integer li_EnableLocusMaps string ls_MapProviderType integer li_EnableAdvancedPackets string ls_EnabledPacketTypes integer li_EnableDataUnload integer li_EnableScanConsumer integer li_EnablePolicyConsumer integer li_EnableLocationConsumer integer li_EnableEmail string ls_FirmwareUpdateStrategy integer li_DeviceJobConcurrency string ls_MapProviderApiKey string ls_WakeupUuid string ls_ReportTimezone string ls_Language string ls_BlufiHostnameNaming integer li_DateCreated integer li_DateUpdated integer li_EnableStreamProducer integer li_EnableMetricStorage integer i integer li_Count_i // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loo_Http = create oleobject // Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 li_rc = loo_Http.ConnectToNewObject("Chilkat.Http") if li_rc < 0 then destroy loo_Http MessageBox("Error","Connecting to COM object failed") return end if // 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' loo_Http.SetRequestHeader("bzid","YOUR_API_KEY_HERE") loo_SbResponseBody = create oleobject // Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder") li_Success = loo_Http.QuickGetSb("https://bluzone.io/portal/papis/v1/projects/YOUR_PROJECT_ID_HERE/",loo_SbResponseBody) if li_Success = 0 then Write-Debug loo_Http.LastErrorText destroy loo_Http destroy loo_SbResponseBody return end if loo_JResp = create oleobject // Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject") loo_JResp.LoadSb(loo_SbResponseBody) loo_JResp.EmitCompact = 0 Write-Debug "Response Body:" Write-Debug loo_JResp.Emit() li_RespStatusCode = loo_Http.LastStatus Write-Debug "Response Status Code = " + string(li_RespStatusCode) if li_RespStatusCode >= 400 then Write-Debug "Response Header:" Write-Debug loo_Http.LastHeader Write-Debug "Failed." destroy loo_Http destroy loo_SbResponseBody destroy loo_JResp return end if // 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 li_ProjectId = loo_JResp.IntOf("projectId") ls_Name = loo_JResp.StringOf("name") ls_Description = loo_JResp.StringOf("description") ls_Status = loo_JResp.StringOf("status") ls_OwnerUsername = loo_JResp.StringOf("owner.username") ls_OwnerEmailAddress = loo_JResp.StringOf("owner.emailAddress") ls_DefaultUuidValue = loo_JResp.StringOf("defaultUuidValue") li_EnableLocusMaps = loo_JResp.BoolOf("enableLocusMaps") ls_MapProviderType = loo_JResp.StringOf("mapProviderType") li_EnableAdvancedPackets = loo_JResp.BoolOf("enableAdvancedPackets") ls_EnabledPacketTypes = loo_JResp.StringOf("enabledPacketTypes") li_EnableDataUnload = loo_JResp.BoolOf("enableDataUnload") li_EnableScanConsumer = loo_JResp.BoolOf("enableScanConsumer") li_EnablePolicyConsumer = loo_JResp.BoolOf("enablePolicyConsumer") li_EnableLocationConsumer = loo_JResp.BoolOf("enableLocationConsumer") li_EnableEmail = loo_JResp.BoolOf("enableEmail") ls_FirmwareUpdateStrategy = loo_JResp.StringOf("firmwareUpdateStrategy") li_DeviceJobConcurrency = loo_JResp.IntOf("deviceJobConcurrency") ls_MapProviderApiKey = loo_JResp.StringOf("mapProviderApiKey") ls_WakeupUuid = loo_JResp.StringOf("wakeupUuid") ls_ReportTimezone = loo_JResp.StringOf("reportTimezone") ls_Language = loo_JResp.StringOf("language") ls_BlufiHostnameNaming = loo_JResp.StringOf("blufiHostnameNaming") li_DateCreated = loo_JResp.IntOf("dateCreated") li_DateUpdated = loo_JResp.IntOf("dateUpdated") li_EnableStreamProducer = loo_JResp.BoolOf("enableStreamProducer") li_EnableMetricStorage = loo_JResp.BoolOf("enableMetricStorage") i = 0 li_Count_i = loo_JResp.SizeOfArray("reportEmailList") do while i < li_Count_i loo_JResp.I = i i = i + 1 loop destroy loo_Http destroy loo_SbResponseBody destroy loo_JResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.