Vehicle Images

List Images for a Vehicle

GET Request: https://api.autoznetwork.com/v1/inventory/{INVENTORY_ID}/images

CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
AUTOZNETWORK_INVENTORY_ID="your vehicle id"

curl https://api.autoznetwork.com/v1/inventory/$AUTOZNETWORK_INVENTORY_ID/images \
  -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
  -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
  -H 'Accept: application/json'
PHP
<?php 
$apiToken = 'ABCD12345 ...';
$organizationId = '1234';
$inventoryId = 'your vehicle id';

$autoZnetwork = new AutozNetwork($apiToken);

$images = $autoznetwork
              ->withOrganization($organizationId)
              ->inventory($inventoryId)
              ->images()
              ->get();

print($images)

Add Images to a Vehicle

When adding images to a vehicle, autoZnetwork will queue the image processing asynchronously. You will receive a 201 response indicating that autoZnetwork has received the request and is currently processing.

POST Request: https://api.autoznetwork.com/v1/inventory/{INVENTORY_ID}/images

CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
AUTOZNETWORK_INVENTORY_ID="your vehicle id"

curl -X POST https://api.autoznetwork.com/v1/inventory/$AUTOZNETWORK_INVENTORY_ID/images \
  -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
  -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    'url':
      'http://yourdomain.com/image1.jpg,http://yourdomain.com/image2.jpg,http://yourdomain.com/image3.jpg'
  }
PHP
<?php 
$apiToken = 'ABCD12345 ...';
$organizationId = '1234';
$inventoryId = 'your vehicle id';

$autoZnetwork = new AutozNetwork($apiToken);

$images = $autoznetwork
              ->withOrganization($organizationId)
              ->inventory($inventoryId)
              ->images()
              ->create([
                'http://yourdomain.com/image1.jpg',
                'http://yourdomain.com/image2.jpg',
                'http://yourdomain.com/image3.jpg',
                ...
              ]);

print($images)

Delete an Image of a Vehicle

DELETE Request: https://api.autoznetwork.com/v1/inventory/{INVENTORY_ID}/images/{IMAGE_ID}

CURL
AUTOZNETWORK_TOKEN="your API token"
AUTOZNETWORK_ORG_ID="your organization id"
AUTOZNETWORK_INVENTORY_ID="your vehicle id"
AUTOZNETNETWORK_IMAGE_ID="your vehicle imag id"

curl -X DELETE https://api.autoznetwork.com/v1/inventory/$AUTOZNETWORK_INVENTORY_ID/images/$AUTOZNETNETWORK_IMAGE_ID \
  -H "Authorization: Bearer $AUTOZNETWORK_TOKEN" \
  -H "X-AutozNetwork-Organization-Id: $AUTOZNETWORK_ORG_ID" \
  -H 'Accept: application/json'
PHP
<?php 
$apiToken = 'ABCD12345 ...';
$organizationId = '1234';
$inventoryId = 'your vehicle id';
$imageId = 'your vehicle image id';

$autoZnetwork = new AutozNetwork($apiToken);

$image = $autoznetwork
              ->withOrganization($organizationId)
              ->inventory($inventoryId)
              ->images($imageId)
              ->delete();

print($image)