queryType: createCustomZone

The createCustomZone queryType is passed to the API to create a new zone that can be used as a custom zone in the various modules.

Parameters

These parameters should be passed to the functionParameters object regardless of which method you choose to make an API request.
ParameterDescriptionTypeDefined Value SetValue Required
queryTypeMust equal createCustomZone .STRINGcreateCustomZoneY

customZone

An object containing the properties of the zone you wish to create. The object contains:

  • ZoneDescription (string) - any string to name the zone.
    Note:

    The zone description is required to be unique within a database.

  • CustomZoneTypes - an array of strings, where each string is a custom zone type ID corresponding to a custom zone type you previously created. At least 1 type must be provided. See createCustomZoneType API above.

  • Comments (string) - optional string to describe the zone.

  • CustomerZoneId (string) - an optional user defined ID that you can provide if you refer to this zone by an ID in your systems.

  • Geography (string) - GeoJSON string representing the boundary of the zone.

OBJECTY

Responses

CodeTypeDescription
200JSONThe requested data.
401JSONOccurs for various unauthorized tasks e.g. if you didn't provide credentials in your parameters.
500JSONOccurs if an internal server error occurs. Contact altitudesupport@geotab.com if this occurs.

Response Schema

AttributeDescriptionData TypeDefined Value Set
CommentsThe comments related to the zone.STRING-
Counties

Array of objects representing counties associated with the custom zone. Each object contains:

  • ISO_3166_2 (string) - unique ISO 3166:2 identifier representing the state/provincial code of a purchased region.

  • CountyId (string) - a unique identifier for a county; typically, the FIPS code or Canadian census subdivision CSDUID from StatCan.

ARRAY-
CreatedByThe user ID of the person who originally created the zone.STRING-
CreatedTimestampThe date and time the zone was created wrapped inside an object with a value attribute.OBJECT-
CustomerZoneIdThe customer zone ID that was assigned on creation.STRING-
CustomZoneTypes

An array of objects where each entry represents a zone type associated with this zone. Each zone type contains:

  • CustomZoneTypeId (string) - unique identifier for the custom zone type.

  • CustomZoneTypeName (string) - name of the custom zone type.

  • CustomZoneTypeStatus (of type number) - The status of the custom zone type. 0 for "Deleted" and 1 for "Active".

ARRAY-
DatabaseThe database in which the zone was created.STRING-
GeographyA GeoJSON string representing the boundary of the zone.STRING-
ISO_3166_2The ISO 3166:2 of the state that covers the majority of the zone.STRING-
ModifiedByThe user ID of the person who last modified the zone type.STRING-
ModifiedByTimestampThe date and time the zone type was last modified wrapped inside an object with a value attribute.OBJECT-
ZoneIdThe unique ID of the zone.STRING-
ZoneDescriptionThe name of the zone.STRING-
ZoneStatusThe status of the custom zone. 0 for “Deleted” and 1 for “Active”STRING

0 for “Deleted” and 1 for “Active”

Sample parameters

{
"customZone": {
    "ZoneDescription": "my custom zone description",
    "CustomZoneTypes": ['zt-<>'],
    "Comments": "new custom zone comments",
    "CustomerZoneId": "my own unique identifier for the custom zone",
    "Geography": '{\"type\":\"Polygon\",\"coordinates\":[[[<coordinate>],[<coordinate>],[<coordinate>],[<coordinate>]]]}'
},
"queryType": "createCustomZone"


}