Skip to content

Preparing Data

POST /product/prepare-data

DELETE /product/prepare-data

Feature development

Prepared data is still in its early stages of development. Unless otherwise agreed upon, you cannot rely on data being associated with products yet.
e.g. data is will not be transferred to products at any point, it is documented here for its purpose and clarity.

Prepared product data is datapoints, documents or images that are known to the application, but not yet utilized. Such data will be transferred to existing or new products on an as-needed basis.

The operation performed depends on the HTTP method used:
- POST for submissions for inserting data.
- DELETE for deleting data.

Submitting prepared data

The table below describes how submissions of new requests are handled, within the scope of the customer to which your API key belongs.

Table legend
Property is required, for child properties this only applies when parent is required.
Either property is required.
Property is optional.

Parameter Required Description
vehicleIdentificationNumber The unique 17-character identifier for the vehicle.
fields An object of key-value pairs for product fields. Required for POST. set to true for DELETE to remove fields.
fields.* keys will be merged with existing, e.g. keys that already exists will be replaced, otherwise inserted. Refer to Fields for a list of available keys
documents An array of documents. Required for POST; set to true for DELETE to remove documents.
documents.documentCategoryID One of the described category IDs from the categories section
documents.documentUrl A valid and accessible URL
documents.private Whether a document is eligible for being uploaded to the AP platform. See Upload documents
images An array of images. Required for POST; set to true for DELETE to remove documents.
images.private Indicates whether an image is eligible for being uploaded to the AP platform. See Upload images
{
    "vehicleIdentificationNumber": string,
    "fields": {
        "isDrivable": mixed,
        "registrationNumber": mixed,
        ... // Other field key-value pais
    },
    "images": [
        {
            "imageUrl": string,
            "private": int
        }
    ],
    "documents": [
        {
            "documentCategoryID": int,
            "documentUrl": string,
            "private": int
        }
    ]
}
{
    "message": {
        "numProductFields": int,
        "numProductImages": int,
        "numProductDocuments": int
    },
    "status": enum
}
<?php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'YOUR-BASEURL/product/prepare-data',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => '{
        "vehicleIdentificationNumber": string,
        "fields": {
            "isDrivable": 1,
            "registrationNumber": "AB12345",
            ... // Other field key-value pais
        },
        "documents": [
            {
                "documentCategoryID": 1,
                "documentUrl": "https://placehold.co/600x400",
                "private": 1
            }
        ],
        "images": [
            {
                "imageUrl": "https://placehold.co/600x400",
                "private": 1
            }
        ]
    }',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-Api-Key: YOUR-API-KEY'
    ],
]);

$response = curl_exec($ch);

curl_close($ch);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "YOUR-BASEURL/product/prepare-data";

        var payload = new StringContent(@"
        {
            ""vehicleIdentificationNumber"": ""string"",
            ""fields"": {
                ""isDrivable"": 1,
                ""registrationNumber"": ""AB12345""
                // Other field key-value pairs
            },
            ""documents"": [
                {
                    ""documentCategoryID"": 1,
                    ""documentUrl"": ""https://placehold.co/600x400"",
                    ""private"": 1
                }
            ],
            ""images"": [
                {
                    ""imageUrl"": ""https://placehold.co/600x400"",
                    ""private"": 1
                }
            ]
        }
        ", Encoding.UTF8, "application/json");

        client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR-API-KEY");

        var response = await client.PostAsync(url, payload);
        var responseString = await response.Content.ReadAsStringAsync();

        Console.WriteLine(responseString);
    }
}
const axios = require('axios');

const data = JSON.stringify({
    "vehicleIdentificationNumber": "string",
    "fields": {
        "isDrivable": 1,
        "registrationNumber": "AB12345"
        // Other field key-value pairs
    },
    "documents": [
        {
        "documentCategoryID": 1,
        "documentUrl": "https://placehold.co/600x400",
        "private": 1
        }
    ],
    "images": [
        {
        "imageUrl": "https://placehold.co/600x400",
        "private": 1
        }
    ]
});

const config = {
    method: 'post',
    url: 'YOUR-BASEURL/product/prepare-data',
    headers: { 
        'Content-Type': 'application/json', 
        'X-Api-Key': 'YOUR-API-KEY'
    },
    data : data
};

axios(config)
.then(function (response) {
    console.log(JSON.stringify(response.data));
})
.catch(function (error) {
    console.log(error);
});
import requests

url = "YOUR-BASEURL/product/prepare-data"

payload = '''
{
    "vehicleIdentificationNumber": "string",
    "fields": {
        "isDrivable": 1,
        "registrationNumber": "AB12345"
        # Other field key-value pairs
    },
    "documents": [
        {
            "documentCategoryID": 1,
            "documentUrl": "https://placehold.co/600x400",
            "private": 1
        }
    ],
    "images": [
        {
            "imageUrl": "https://placehold.co/600x400",
            "private": 1
        }
    ]
}
'''
headers = {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR-API-KEY',
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Uploading resources

Validation & Upload Process

Ensure that the documents, and images comply with the expected formats and types. Validation rules apply for each type of data submitted.
Refer to sections Upload documents and Upload images for more information.

Document category limitations

Some document categories does not allow multiple documents being uploaded, submitting another URL to one of those categories, will permanently replace the existing.
Refer to the categories section for more information.

For operations involving a significant number of images, we highly recommend submitting URLs in bulk. It is possible to make the same request multiple times, with different URLs in the documents and images sections.

You may also simply leave out the sections not relevant.
As long as the same value for vehicleIdentificationNumber is used across all requests.

Should your upload process encounter an unexpected error, you may perform a DELETE to ensure data is deleted, and re-start the process.

Example

{
    "vehicleIdentificationNumber": string,
    "images": [
        {"imageUrl": string, "private": int},
        {"imageUrl": string, "private": int},
        {"imageUrl": string, "private": int}
    ]
}
{
    "message": {
        "numProductFields": int,
        "numProductImages": int,
        "numProductDocuments": int
    },
    "status": enum
}
<?php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'YOUR-BASEURL/product/prepare-data',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => '{
        "vehicleIdentificationNumber": string,
        "images": [
            {"imageUrl": "https://placehold.co/600x400", "private": 1},
            {"imageUrl": "https://placehold.co/600x400", "private": 1},
            {"imageUrl": "https://placehold.co/600x400", "private": 1}
        ]
    }',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-Api-Key: YOUR-API-KEY'
    ],
]);

$response = curl_exec($ch);

curl_close($ch);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "YOUR-BASEURL/product/prepare-data";

        var payload = new StringContent(@"
        {
            ""vehicleIdentificationNumber"": ""string"",
            ""images"": [
                {""imageUrl"": ""https://placehold.co/600x400"", ""private"": 1},
                {""imageUrl"": ""https://placehold.co/600x400"", ""private"": 1},
                {""imageUrl"": ""https://placehold.co/600x400"", ""private"": 1}
            ]
        }
        ", Encoding.UTF8, "application/json");

        client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR-API-KEY");

        var response = await client.PostAsync(url, payload);
        var responseString = await response.Content.ReadAsStringAsync();

        Console.WriteLine(responseString);
    }
}
const axios = require('axios');

const data = JSON.stringify({
"vehicleIdentificationNumber": "string",
"images": [
    {"imageUrl": "https://placehold.co/600x400", "private": 1},
    {"imageUrl": "https://placehold.co/600x400", "private": 1},
    {"imageUrl": "https://placehold.co/600x400", "private": 1}
]
});

const config = {
    method: 'post',
    url: 'YOUR-BASEURL/product/prepare-data',
    headers: { 
        'Content-Type': 'application/json', 
        'X-Api-Key': 'YOUR-API-KEY'
    },
    data : data
};

axios(config)
.then(function (response) {
    console.log(JSON.stringify(response.data));
})
.catch(function (error) {
    console.log(error);
});
import requests

url = "YOUR-BASEURL/product/prepare-data"

payload = '''
{
    "vehicleIdentificationNumber": "string",
    "images": [
        {"imageUrl": "https://placehold.co/600x400", "private": 1},
        {"imageUrl": "https://placehold.co/600x400", "private": 1},
        {"imageUrl": "https://placehold.co/600x400", "private": 1}
    ]
}
'''
headers = {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR-API-KEY',
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Example:

{
    "vehicleIdentificationNumber": string,
    "documents": [
        {"documentUrl": string, "private": int},
        {"documentUrl": string, "private": int},
        {"documentUrl": string, "private": int}
    ]
}
{
    "message": {
        "numProductFields": int,
        "numProductImages": int,
        "numProductDocuments": int
    },
    "status": enum
}
<?php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'YOUR-BASEURL/product/prepare-data',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => '{
        "vehicleIdentificationNumber": string,
        "documents": [
            {"documentUrl": "https://placehold.co/600x400", "private": 1},
            {"documentUrl": "https://placehold.co/600x400", "private": 1},
            {"documentUrl": "https://placehold.co/600x400", "private": 1}
        ]
    }',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-Api-Key: YOUR-API-KEY'
    ],
]);

$response = curl_exec($ch);

curl_close($ch);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "YOUR-BASEURL/product/prepare-data";

        var payload = new StringContent(@"
        {
            ""vehicleIdentificationNumber"": ""string"",
            ""documents"": [
                {""documentUrl"": ""https://placehold.co/600x400"", ""private"": 1},
                {""documentUrl"": ""https://placehold.co/600x400"", ""private"": 1},
                {""documentUrl"": ""https://placehold.co/600x400"", ""private"": 1}
            ]
        }
        ", Encoding.UTF8, "application/json");

        client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR-API-KEY");

        var response = await client.PostAsync(url, payload);
        var responseString = await response.Content.ReadAsStringAsync();

        Console.WriteLine(responseString);
    }
}
const axios = require('axios');

const data = JSON.stringify({
    "vehicleIdentificationNumber": "string",
    "documents": [
        {"documentUrl": "https://placehold.co/600x400", "private": 1},
        {"documentUrl": "https://placehold.co/600x400", "private": 1},
        {"documentUrl": "https://placehold.co/600x400", "private": 1}
    ]
});

const config = {
    method: 'post',
    url: 'YOUR-BASEURL/product/prepare-data',
    headers: { 
        'Content-Type': 'application/json', 
        'X-Api-Key': 'YOUR-API-KEY'
    },
    data : data
};

axios(config)
.then(function (response) {
    console.log(JSON.stringify(response.data));
})
.catch(function (error) {
    console.log(error);
});
import requests

url = "YOUR-BASEURL/product/prepare-data"

payload = '''
{
    "vehicleIdentificationNumber": "string",
    "documents": [
        {"documentUrl": "https://placehold.co/600x400", "private": 1},
        {"documentUrl": "https://placehold.co/600x400", "private": 1},
        {"documentUrl": "https://placehold.co/600x400", "private": 1}
    ]
}
'''
headers = {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR-API-KEY',
}

response = requests.post(url, headers=headers, data=payload)

print(response.text)

Deleting existing prepared data

Data deletion

Data is deleted permanently without confirmation. Exercise caution to prevent unintentional data loss.

Setting fields, documents, or images to true will delete all prepared data associated for that section with the specified vehicleIdentificationNumber.

The properties fields, documents, or images may all be used in conjunction in a single request, or individually in multiple requests.

Delete all prepared date for vehicleIdentificationNumber

{
    "vehicleIdentificationNumber": string,
    "fields": bool,
    "documents": bool,
    "images": bool
}
{
    "message": {
        "numProductFields": int,
        "numProductImages": int,
        "numProductDocuments": int
    },
    "status": enum
}
<?php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'YOUR-BASEURL/product/prepare-data',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => '{
        "vehicleIdentificationNumber": string,
        "fields": true,
        "documents": true,
        "images": true
    }',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-Api-Key: YOUR-API-KEY'
    ],
]);

$response = curl_exec($ch);

curl_close($ch);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "YOUR-BASEURL/product/prepare-data";

        var payload = new StringContent(@"
        {
            ""vehicleIdentificationNumber"": ""string"",
            ""fields"": true,
            ""documents"": true,
            ""images"": true
        }
        ", Encoding.UTF8, "application/json");

        client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR-API-KEY");

        var response = await client.PostAsync(url, payload);
        var responseString = await response.Content.ReadAsStringAsync();

        Console.WriteLine(responseString);
    }
}
const axios = require('axios');

const data = JSON.stringify({
    "vehicleIdentificationNumber": "string",
    "fields": true,
    "documents": true,
    "images": true
});

const config = {
    method: 'post',
    url: 'YOUR-BASEURL/product/prepare-data',
    headers: { 
        'Content-Type': 'application/json', 
        'X-Api-Key': 'YOUR-API-KEY'
    },
    data: data
};

axios(config)
.then(function (response) {
    console.log(JSON.stringify(response.data));
})
.catch(function (error) {
    console.log(error);
});
import requests

url = "YOUR-BASEURL/product/prepare-data"

payload = '''
{
    "vehicleIdentificationNumber": "string",
    "fields": true,
    "documents": true,
    "images": true
}
'''
headers = {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR-API-KEY',
}

response = requests.post(url, headers=headers, data=payload)

print(response.text)

Delete field data only:

{
    "vehicleIdentificationNumber": string,
    "fields": bool
}
{
    "message": {
        "numProductFields": int,
        "numProductImages": int,
        "numProductDocuments": int
    },
    "status": enum
}
<?php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'YOUR-BASEURL/product/prepare-data',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => '{
        "vehicleIdentificationNumber": string,
        "fields": true
    }',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-Api-Key: YOUR-API-KEY'
    ],
]);

$response = curl_exec($ch);

curl_close($ch);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "YOUR-BASEURL/product/prepare-data";

        var payload = new StringContent(@"
        {
            ""vehicleIdentificationNumber"": ""string"",
            ""fields"": true
        }
        ", Encoding.UTF8, "application/json");

        client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR-API-KEY");

        var response = await client.PostAsync(url, payload);
        var responseString = await response.Content.ReadAsStringAsync();

        Console.WriteLine(responseString);
    }
}
const axios = require('axios');

const data = JSON.stringify({
    "vehicleIdentificationNumber": "string",
    "fields": true
});

const config = {
    method: 'post',
    url: 'YOUR-BASEURL/product/prepare-data',
    headers: { 
        'Content-Type': 'application/json', 
        'X-Api-Key': 'YOUR-API-KEY'
    },
    data: data
};

axios(config)
.then(function (response) {
    console.log(JSON.stringify(response.data));
})
.catch(function (error) {
    console.log(error);
});
import requests

url = "YOUR-BASEURL/product/prepare-data"

payload = '''
{
    "vehicleIdentificationNumber": "string",
    "fields": true
}
'''
headers = {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR-API-KEY',
}

response = requests.post(url, headers=headers, data=payload)

print(response.text)

Delete images only:

{
    "vehicleIdentificationNumber": string,
    "images": bool
}
{
    "message": {
        "numProductFields": int,
        "numProductImages": int,
        "numProductDocuments": int
    },
    "status": enum
}
<?php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'YOUR-BASEURL/product/prepare-data',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => '{
        "vehicleIdentificationNumber": string,
        "images": true
    }',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-Api-Key: YOUR-API-KEY'
    ],
]);

$response = curl_exec($ch);

curl_close($ch);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "YOUR-BASEURL/product/prepare-data";

        var payload = new StringContent(@"
        {
            ""vehicleIdentificationNumber"": ""string"",
            ""images"": true
        }
        ", Encoding.UTF8, "application/json");

        client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR-API-KEY");

        var response = await client.PostAsync(url, payload);
        var responseString = await response.Content.ReadAsStringAsync();

        Console.WriteLine(responseString);
    }
}
const axios = require('axios');

const data = JSON.stringify({
    "vehicleIdentificationNumber": "string",
    "images": true
});

const config = {
    method: 'post',
    url: 'YOUR-BASEURL/product/prepare-data',
    headers: { 
        'Content-Type': 'application/json', 
        'X-Api-Key': 'YOUR-API-KEY'
    },
    data: data
};

axios(config)
.then(function (response) {
    console.log(JSON.stringify(response.data));
})
.catch(function (error) {
    console.log(error);
});
import requests

url = "YOUR-BASEURL/product/prepare-data"

payload = '''
{
    "vehicleIdentificationNumber": "string",
    "images": true
}
'''
headers = {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR-API-KEY',
}

response = requests.post(url, headers=headers, data=payload)

print(response.text)

Delete documents only:

{
    "vehicleIdentificationNumber": string,
    "documents": bool
}
{
    "message": {
        "numProductFields": int,
        "numProductImages": int,
        "numProductDocuments": int
    },
    "status": enum
}
<?php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'YOUR-BASEURL/product/prepare-data',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => '{
        "vehicleIdentificationNumber": string,
        "documents": true
    }',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'X-Api-Key: YOUR-API-KEY'
    ],
]);

$response = curl_exec($ch);

curl_close($ch);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program
{
    static async Task Main()
    {
        var client = new HttpClient();
        var url = "YOUR-BASEURL/product/prepare-data";

        var payload = new StringContent(@"
        {
            ""vehicleIdentificationNumber"": ""string"",
            ""documents"": true
        }
        ", Encoding.UTF8, "application/json");

        client.DefaultRequestHeaders.Add("X-Api-Key", "YOUR-API-KEY");

        var response = await client.PostAsync(url, payload);
        var responseString = await response.Content.ReadAsStringAsync();

        Console.WriteLine(responseString);
    }
}
const axios = require('axios');

const data = JSON.stringify({
    "vehicleIdentificationNumber": "string",
    "documents": true
});

const config = {
    method: 'post',
    url: 'YOUR-BASEURL/product/prepare-data',
    headers: { 
        'Content-Type': 'application/json', 
        'X-Api-Key': 'YOUR-API-KEY'
    },
    data: data
};

axios(config)
.then(function (response) {
    console.log(JSON.stringify(response.data));
})
.catch(function (error) {
    console.log(error);
});
import requests

url = "YOUR-BASEURL/product/prepare-data"

payload = '''
{
    "vehicleIdentificationNumber": "string",
    "documents": true
}
'''
headers = {
    'Content-Type': 'application/json',
    'X-Api-Key': 'YOUR-API-KEY',
}

response = requests.post(url, headers=headers, data=payload)

print(response.text)

Error Codes

The table helps you quickly identify errors, whether you're missing a field or lack permissions.

Should you encounter any error no listed here, please enquire with your dedicated FLEETproff contact person, with a detailed explanation and timestamp of how and when the error occured.

Error Message Resolution HTTP Status Code
"'vehicleIdentificationNumber' is a required field" Ensure your request includes the vehicleIdentificationNumber field with a valid value. 422 Unprocessable Entity
"One of the following top-level properties are required: [fields, documents, images]" Include at least one of the following top-level properties in your request: fields, documents, or images. 422 Unprocessable Entity
"The following fields are not allowed: [list of disallowed fields]" Remove any fields from the fields property that are not allowed or check for typographical errors in the fieldKey names. 422 Unprocessable Entity
"'documents' cannot be empty" If you include a documents property in your POST request, ensure it contains at least one valid document. 422 Unprocessable Entity
"'images' cannot be empty" If you include an images property in your POST request, ensure it contains at least one valid image. 422 Unprocessable Entity
"Forbidden" Verify that you have the required permissions to upload resources. Inquire with your dedicated FLEETproff contact for assistance. 403 Forbidden