Link Search Menu Expand Document

GET /v1/products/:product_slug

This endpoint will return data that can be used to construct a form for requesting a quote. This includes information about the product in general, and rates and loadings that are required to generate a valid quotation.

Each product consists of a number of parameters, both required and optional, that can be used to generate a quote.

Path Parameters

product_slug – string, required

When providing one of the of the parameters to get a quote, use the identifier property. For instance, from the example response above, to specify that the mode of transport the insured goods are taking is “Land”, the relevant value in the JSON object you POST to the quotes endpoint would be:

{
  "transport_mode": "LND"
}

Optional Query Parameters

You may also optional add a date parameter to the query string (YYYY-MM-DD format) to retrieve the product info as it was/will be for that date. Sometimes product info changes, but we always maintain the previous settings. Also, if product info is going to be updated, we’re able to add the new settings to become active on a given date, so future dates are also acceptable for this paramter. The URL would look something like:

https://api.staging-agileaperture.com/v1/products/cargo?date=2021-07-01

Example Requests

cURL

curl --request GET \
  --url https://api.staging-agileaperture.com/v1/products/cargo \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJwYXJ0bmVyX2lkIjoiMTIzMzIzNjgtMjcwNS00ZTNiLWI3OTUtY2Y3YWUwOGRlZWE3IiwiaWF0IjoxNTU4NTY5MzY1fQ.q0_oulKwggDw1yQcM877OXhOm2X6sVOhUNnu7_jUzmg' \
  --header 'Content-Type: application/json'

Node

const fetch = require('node-fetch');

const url = 'https://api.staging-agileaperture.com/v1/products/cargo';

const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJwYXJ0bmVyX2lkIjoiMTIzMzIzNjgtMjcwNS00ZTNiLWI3OTUtY2Y3YWUwOGRlZWE3IiwiaWF0IjoxNTU4NTY5MzY1fQ.q0_oulKwggDw1yQcM877OXhOm2X6sVOhUNnu7_jUzmg',
    'Content-Type': 'application/json'
  }
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));

Ruby

require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://api.staging-agileaperture.com/v1/products/cargo")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJwYXJ0bmVyX2lkIjoiMTIzMzIzNjgtMjcwNS00ZTNiLWI3OTUtY2Y3YWUwOGRlZWE3IiwiaWF0IjoxNTU4NTY5MzY1fQ.q0_oulKwggDw1yQcM877OXhOm2X6sVOhUNnu7_jUzmg'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body

Javascript

const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer eyJhbGciOiJIUzI1NiJ9.eyJwYXJ0bmVyX2lkIjoiMTIzMzIzNjgtMjcwNS00ZTNiLWI3OTUtY2Y3YWUwOGRlZWE3IiwiaWF0IjoxNTU4NTY5MzY1fQ.q0_oulKwggDw1yQcM877OXhOm2X6sVOhUNnu7_jUzmg',
    'Content-Type': 'application/json'
  }
};

fetch('https://api.staging-agileaperture.com/v1/products/cargo', options)
  .then(response => console.log(response))
  .catch(err => console.error(err));

Python

import requests

url = "https://api.staging-agileaperture.com/v1/products/cargo"

headers = {
    "Authorization": "Bearer eyJhbGciOiJIUzI1NiJ9.eyJwYXJ0bmVyX2lkIjoiMTIzMzIzNjgtMjcwNS00ZTNiLWI3OTUtY2Y3YWUwOGRlZWE3IiwiaWF0IjoxNTU4NTY5MzY1fQ.q0_oulKwggDw1yQcM877OXhOm2X6sVOhUNnu7_jUzmg",
    "Content-Type": "application/json"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

Responses examples


200 OK

{
	"name": "Cargo Cover",
	"pds_url": "https://herokuapp.com/products/cargo/Agile-Cargo-Cover-PDS.pdf",
	"max_insured_value": 500000,
	"benefits": [
		{
			"title": "To your door",
			"description": "This insurance attaches from the time the goods are first moved in the warehouse or at the place of storage for the purpose of the immediate loading into or onto the Conveyance for the commencement of Transit, continues during the ordinary course of transit and terminates on completion of unloading from the Conveyance in or at the final destination as nominated by You."
		},
		{
			"title": "Loss or damage",
			"description": "Subject to the terms, Conditions of Cover and exclusions of this Policy, We will insure You up to the Sum Insured for loss of or damage to the Goods occurring whilst in Transit during the Period of Insurance caused by Accidental Damage."
		}
	],
	"selectors": {
		"insured_items_category": [
			{
				"identifier": "ACID",
				"label": "Acids"
			},
			{
				"identifier": "AGRI",
				"label": "Agricultural Products - bagged"
			}
		],
		"country": [
			{
				"identifier": "AO",
				"label": "Angola"
			},
			{
				"identifier": "AT",
				"label": "Austria"
			},
			{
				"identifier": "SN",
				"label": "Senegal"
			}
		],
		"transport_mode": [
			{
				"identifier": "AIR",
				"label": "Air"
			},
			{
				"identifier": "LND",
				"label": "Land"
			},
			{
				"identifier": "SEA",
				"label": "Sea"
			},
			{
				"identifier": "CMB",
				"label": "Combination"
			}
		]
	}
}