Location Groups
A default location group is created for every organization.
A Location Group instance resource represents a group of locations within an Organization. This is usually used for locations within close proximity.
Properties
Property | Type | Description |
---|---|---|
id | Integer | The ID of the Location. |
default | Boolean | Identifies the Location Group as default. |
name | String | Friendly name for the Location. |
coordinates | Object | Latitude and Longitude of a central point for the group. |
created_at | DateTime | DateTime the Location was created in autoZnetwork's system. |
updated_at | DateTime | DateTime the Location was last updated in autoZnetwork's system. |
Relationships
Relationship | Description |
---|---|
Organization | The Organization the Location Group belongs to. |
Locations | The locations that are contained within the Location Group. |
List Location Groups
GET Request: https://api.autoznetwork.com/v1/location_groups
CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
curl https://api.autoznetwork.com/v1/location_groups \
-H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
-H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
-H 'Accept: application/json'
Add a Location Group
POST Request: https://api.autoznetwork.com/v1/location_groups
CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
curl -X POST https://api.autoznetwork.com/v1/location_groups \
-H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
-H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "your location group name",
}'
Update a Location Group
PUT Request: https://api.autoznetwork.com/v1/location_groups/{LOCATION_GROUP_ID}
CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
curl -X PUT https://api.autoznetwork.com/v1/location_groups \
-H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
-H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "your NEW location group name",
}'
Remove a Location Group
DELETE Request: https://api.autoznetwork.com/v1/location_groups/{LOCATION_GROUP_ID}
CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
AUTOZNETWORK_LOCATION_GROUP_ID="your location id"
curl -X DELETE https://api.autoznetwork.com/v1/location_groups/$AUTOZNETWORK_LOCATION_GROUP_ID \
-H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
-H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
-H 'Accept: application/json'