BluFI Template APIs

Bluzone uses a template concept to configure BluFIs.The BluFI template can be considered a provisioning profile that must be assigned to a BluFI during provisioning time. The Bluzone workflow follows a best practices approach to enterprise configuration and device management.  The BluFI template API exposes a list of available templates as well as REST endpoints for creating and editing the template.  

BluFI templates must be directly scoped to a project (as most entities in Bluzone data model), and must capture the following values at a minimum:  Name, ProjectId, SecurityType, passphrase.

REST API Detail

https://bluzone.io/portal/static/docs/index.html

BlufiTemplates

https://bluzone.io/portal/static/docs/index.html#_blufitemplates_resource

Example Delete BluFI Template(s)

This API supports a bulk process. You can PUT an array of BluFI template IDs and the service will delete them.  This process is transactional.  All must delete with success or none will be deleted and an error will be returned.  On success, Bluzone responds with a 204 Success, no content.  

Delete Blufi Template(s)
curl -X PUT \
  https://bluzone.io/portal/papis/v1/projects/$YOUR_PROJECT_ID/blufiTemplates \
  -H 'accept: application/json' \
  -H 'bzid: $YOUR_API_KEY_HERE' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '[10001,10002,10003]'

NOTE:  Starting November 1, the above API will be deprecated in favor of the below pattern which adds the "/_delete" to the endpoint.  This change makes the API more consistent with other Bluzone bulk delete APIs.

Alternate delete API
curl -X POST \
  https://bluzone.io/portal/papis/v1/projects/$YOUR_PROJECT_ID/blufiTemplates/_delete \
  -H 'accept: application/json' \
  -H 'bzid: $YOUR_API_KEY_HERE' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -d '[10001,10002,10003]'

Example Create BluFI Template

Create a BlufiTemplate
curl --request POST \
  --url https://bluzone.io/portal/papis/v1/projects/988/blufiTemplates \
  --header 'accept: application/json' \
  --header 'bzid: MY_BZ_API_KEY' \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --data '
	{
		"name": "My Blufi Template",
		"ssid": "myssid",
		"projectId": 988,
		"tags": [
			{
				"tagId": 2726,
				"projectId": 988,
				"value": "room-387",
				"displayName": "room-387"
			},{
				"tagId": 2727,
				"projectId": 988,
				"value": "blufi",
				"displayName": "blufi"
			},{
				"tagId": 2728,
				"projectId": 988,
				"value": "wh-123",
				"displayName": "wh-123"
			}
		],
		"securityType": {
			"securityTypeKey": "WPA2",
			"enterprise": false
		},
		"passphrase": "mywifipasscode"
	}'


Sample - Get All BluFI Templates For a Project

Get All BlufiTemplates
curl --request GET \
>   --url https://bluzone.io/portal/papis/v1/projects/988/blufiTemplates \
>   --header 'accept: application/json' \
>   --header 'bzid: MY_BZ_API_KEY' \
>   --header 'cache-control: no-cache' \
>   --header 'content-type: application/json'
[
	{
		"wifiProfileId": null,
		"templateId": 2307,
		"edgeDeviceId": null,
		"projectId": 988,
		"name": "My Blufi Template",
		"description": null,
		"ssid": "myssid",
		"channels": "1,2,3,4,5,6,7,8,9,10,11,12,13,14",
		"rssiThreshold": -99,
		"securityType": {
			"securityTypeKey": "WPA2",
			"enterprise": false
		},
		"username": null,
		"passphrase": "my-wifi-password",
		"certFileName": null,
		"certData": null,
		"tags": [
			{
				"tagId": 2726,
				"projectId": 988,
				"value": "room-387",
				"displayName": "room-387"
			},
			{
				"tagId": 2727,
				"projectId": 988,
				"value": "blufi",
				"displayName": "blufi"
			},
			{
				"tagId": 2728,
				"projectId": 988,
				"value": "wh-123",
				"displayName": "wh-123"
			}
		],
		"policies": [

		],
		"scanMode": {
			"scanModeId": 1,
			"name": "System Beacon Management Scan Mode",
			"description": "Optimized for remote beacon configuration",
			"assetTrackingMode": false,
			"deviceJobMode": false,
			"scanInterval": 80,
			"scanWindow": 80,
			"channels": "37,38,39,2491,2498,255",
			"channelCycles": "1,1,1,10,10,0",
			"channelCount": 6,
			"trackingChannels": "",
			"idleCycles": 0,
			"scanMode": 0,
			"wifiProbe": false,
			"startFrequency": 0,
			"frequencyStep": 0,
			"sweepChannelCount": 0,
			"sweepMode": 0,
			"dwellTime": 24,
			"scanDelayTime": -11,
			"maxNoise": 0,
			"minSnr": 0,
			"maxSnr": 0,
			"wifiProbeChannel": 6,
			"wifiProbeInterval": 0,
			"wifiProbeWindow": 0,
			"dateCreated": 1463515421000,
			"dateUpdated": null
		},
		"sleepSchedule": null,
		"assetTrackingEnabled": false,
		"autoCreatePLSPolicy": false,
		"dateCreated": 1500907953000,
		"dateUpdated": 1500907953000
	}
]