API Response Structure

This page describes the response structure of successful API queries

Unless explicitly mentioned, JSON will be returned in all responses.

Each successful query response will be returned in a standard structure. The following table provides an explanation of each key/value that is returned

Standard JSON response:

{
    "account": {
        "subscriber": "YOUR_SUBSCRIPTON_KEY",
        "name": "YOUR NAME"
        "subscription_active": "1",
        "subscription_plan_name": "Executive",
        "subscription_renewal_date": "15-01-2021",
        "no_api_calls_allowed": 2000,
        "no_api_calls_used": "209"
    },
    "response": {
        "code": "200",
        "code_description": "Ok",
        "message": "Query successful"
    },
    "search": {
        "car_searched": {
            "carID": "XXXXXXX",
            "vrm": "",
            "manufacturer": "PEUGEOT",
            "model": "508",
            "body_type": "Hatchback",
            "detailed_model_name": "1.6 Hybrid Allure Premium 5dr e-EAT8",
            "years": "2020 - ",
            "boot_measurement_available": "Yes",
            "lower_boot_measurements_available": "No",
            "third_row_measurements_available": "No",
            "measurements_requested": "boot"
        },
        "buggy_searched": {
            "brand_id": "35"
            "brand_name": "Phil and Teds",
            "buggy_model_id": "557",
            "buggy_model_name": "mod",
            "buggy_variant_name": "Capri",
            "buggy_folded_dimensions": "71.00 x 57.00 x 32.00",            
            "buggy_dimensions": "Standard measurements",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault300/brands/phil-and-teds/557-phil-and-teds-mod-cap...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/phil-and-teds/557-phil-and-teds-mod-cap..."
            }   
        }
    },
    "results": [
        {
            "willItFit": "Yes",
            "fitLayingDownLR": "Yes",
            "fitLayingDownFB": "Yes",
            "fitLayingDownOnSide": "Yes",
            "fitLayingDownOnEnd": "Yes",
            "error_message": "The search was successful"
        }
    ]
}

account

This part of the returned JSON provides details about your account subscription. It is intended to provide confidence that your credentials and subscription plan are correct, however, it also provides a running total of the number of queries you've made this month.

The details return in the account section should be safe-guarded and not published on your system for consumption

Standard JSON response:

{
    "account": {
        "subscriber": "YOUR_SUBSCRIPTON_KEY",
        "name": "YOUR NAME"
        "subscription_active": "1",
        "subscription_plan_name": "Executive",
        "subscription_renewal_date": "15-01-2021",        
        "no_api_calls_allowed": 2000,
        "no_api_calls_used": "209"
    }
}

response

This section provides a 'technical' response code intended to provide the developer with some basic 'debug' information to explain the reason for the code. The message value will contain any comments returns from the query.

Standard JSON response:

{

    "response": {
        "code": "200",
        "code_description": "Ok",
        "message": "Query successful"
    }
}

Note - The code values that are returned mirror HTTP response codes. HTTP response codes are also set but we would recommend parsing this response for errors rather than relying on the HTTP response code.

We don't recommend these details are published on your system

This section of the JSON response returns details about the query that has been requested. Depending on the type of query, the array contained within will change. In general, if a car-based search has been performed then the car_searched array will be returned. If a buggy-based query is performed then the buggy_searched array will be returned. In some cases, both are returned and in some cases only a basic response is provided (for example where the query doesn't require any parameters to be provided)

Standard JSON response:

{
    "search": {
        "car_searched": {
            "carID": "xxxxxxx",
            "vrm": "",
            "manufacturer": "PEUGEOT",
            "model": "508",
            "body_type": "Hatchback",
            "detailed_model_name": "1.6 Hybrid Allure Premium 5dr e-EAT8",
            "years": "2020 - ",
            "boot_measurement_available": "Yes",
            "lower_boot_measurements_available": "No",
            "third_row_measurements_available": "No",
            "measurements_requested": "boot"
        },
        "buggy_searched": {
            "brand_id": "35"
            "brand_name": "Phil and Teds",
            "buggy_model_id": "557",
            "buggy_model_name": "mod",
            "buggy_variant_name": "Capri",
            "buggy_folded_dimensions": "71.00 x 57.00 x 32.00",            
            "buggy_dimensions": "Standard measurements",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault300/brands/phil-and-teds/557-phil-and-teds-mod-cap...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/phil-and-teds/557-phil-and-teds-mod-cap..."
            }
        }
    }
}

results

This section of the JSON response contains the results returned by each query. Each query returns a different results array - please refer to the documentation for each query.

Standard JSON response:

{
    "results": [
        {
            "willItFit": "Yes",
            "fitLayingDownLR": "Yes",
            "fitLayingDownFB": "Yes",
            "fitLayingDownOnSide": "Yes",
            "fitLayingDownOnEnd": "Yes",
            "error_message": "The search was successful"
        }
    ]
}

Last updated