Locations
Interface with the autoZnetwork locations.
Locations (Rooftops)
**A location belongs to an organization and is a traditional rooftop for a dealership. This is a parent child relationship, an organization should always have at least one location.
A Location instance resource represents a location within your Organization.
The inventory list resource represents all of the locations that you have created in your account within autoZnetwork. You can POST to the Location resource to create a new location.
Properties
| Property | Type | Description |
|---|---|---|
id | Integer | The ID of the Location. |
active | Boolean | Identifies the Location as active. Use this as an alternative to deleting the location. |
name | String | Friendly name for the Location. |
phone_number | String | Associated phone number. |
email | String | Associated email address. |
crm_email | String | Associated CRM email for ADF formatted emails. |
street_address | String | Associated street address. |
city | String | Associated city. |
state | String | Associated state (2 Characters IE: WA, TX, AZ). |
zip | String | Associated zip code. |
coordinates | Object | Latitude and Longitude for the location. |
ip_address | String | IP address associated the location. |
active | Boolean | Toggles the location's active status. |
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 belongs to. |
| Location Group | The Location Group that the Location belongs to. |
List Locations
GET Request: https://api.autoznetwork.com/v1/locations
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
curl https://api.autoznetwork.com/v1/locations \
-H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
-H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
-H 'Accept: application/json'
<?php
$apiToken = 'ABCD12345 ...';
$organizationId = '1234';
$autoZnetwork = new AutozNetwork($apiToken);
$locations = $autoznetwork
->withOrganization($organizationId)
->locations()
->get();
print($locations)
Add a Location
POST Request: https://api.autoznetwork.com/v1/locations
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
curl -X POST https://api.autoznetwork.com/v1/locations \
-H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
-H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"active": true,
"name": "your location name",
"phone_number": "+1234567890",
"email": "location@mydealership.com",
"crm_email": "crm_email@mydealership.com",
"street_address": "1234 N St",
"city": "Seattle",
"state": "WA",
"zip": "12345"
}'
<?php
$apiToken = 'ABCD12345 ...';
$organizationId = '1234';
$autoZnetwork = new AutozNetwork($apiToken);
$location = $autoZnetwork
->withOrganization($organizationId)
->locations()
->create([
'active' => true,
'name' => 'your location name'
]);
print($location)
Update a Location
PUT Request: https://api.autoznetwork.com/v1/locations/{LOCATION_ID}
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
AUTOZNETWORK_LOCATION_ID="your location id"
curl -X PUT https://api.autoznetwork.com/v1/locations/$AUTOZNETWORK_LOCATION_ID \
-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 name",
}'
<?php
$apiToken = 'ABCD12345 ...';
$organizationId = '1234';
$autoZnetwork = new AutozNetwork($apiToken);
$location = $autoZnetwork
->withOrganization($organizationId)
->locations()
->update([
'name' => 'your NEW location name'
]);
print($location)
Remove a Location
DELETE Request: https://api.autoznetwork.com/v1/locations/{LOCATION_ID}
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
AUTOZNETWORK_LOCATION_ID="your location id"
curl -X DELETE https://api.autoznetwork.com/v1/locations/$AUTOZNETWORK_LOCATION_ID \
-H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
-H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
-H 'Accept: application/json'
<?php
$apiToken = 'ABCD12345 ...';
$organizationId = '1234';
$locationId = '9876';
$autoZnetwork = new AutozNetwork($apiToken);
$location = $autoZnetwork
->withOrganization($organizationId)
->locations($locationId)
->delete();
print($location)