Table of Contents |
---|
Subscribe to our email list to receive updates about our API here.
...
Use the
orderId
and get the order from our API described in Get orderLoop through assets and do necessary actions
Files can occur on both order level and order line level.
Example (JavaScript)
Code Block fetch('https://beta-api.ambita.com/kode/v1/orders/:orderId') .then(response => { response.orders.forEach(order => { if (order.assets.length > 0) { // loop through order assets and do necessary actions } order.orderLines.forEach(orderLine => { if (orderLine.assets.length > 0) { // loop through order line assets and do necessary actions } }); }) });
Delete or save the file
Response from
https://beta-api.ambita.com/kode/v1/orders/:orderId
Code Block { "id": 1234567, "status": "PROGRESS", ... "orders": [ { "id": 1234567, "supplierName": "Infoland Kommune - demo", "assets": [ ... ], ... "orderLines": [ { "id": 12345678, "assets": [ ... ]
Take a look at the Get delivered files section, the id of the asset will be unique and should be stored in your system. Use this id as a reference to check if you have downloaded the asset before, this way you won’t end up with duplicates. You should also check the status of the asset and delete the file if it has status
DELETED
.
Get order
To get an order, you need to use the access_token
that you previously obtained.
Send a GET request to https://beta-api.ambita.com/kode/v1/orders/1234567
Take a look at our Swagger documentation for the API here: Swagger
Example request
...
.
...
Example response
Get delivered files
Here you can find information about assets in our API
Asset object
Code Block |
---|
{
"name": "The-exact-name-of-the-file.pdf",
"filename": "More-descriptive-name-of-the-file.pdf",
"downloadUrl": "https://beta-api.ambita.com/shopping/v2/assets/d2f48dk9d267a86d2858244d0c2c1937",
"assetStatus": "OK",
"productCategory": "PRODUCT_UTEN_KATEGORI",
"id": "d2f48dk9d267a86d2858244d0c2c1937"
}
|
...
Property
...
Description
...
name
...
The name of the file that is uploaded to our system
...
filename
...
A descriptive filename that we create based on product name
...
downloadUrl
...
The URL to where you can download the file
...
assetStatus
...
The status of the asset, see section below
...
productCategory
...
The category of the asset, can be used to categorize files or cost, see section below
...
id
...
Unique id for each asset
Asset status
...
Status
...
Description
...
OK
...
The asset is available and can be downloaded
...
DELETED
...
The asset is deleted and is no longer available, you should remove the file from your system
Product categories
Available product categories
...
Product category
...
PRODUKT_UTEN_KATEGORI
...
KOMMUNAL_INFORMASJON
...
PLAN_KART_REGULERING
...
FERDIGATTEST_OG_MIDLERTIDIG_BRUKSTILLATELSE
File types
Most of the files are PDFs, but we also deliver other file types, these are the most common types:
...
...
.txt
...
.xlsx, .xls, .csv
...
.jpg, .png
...
.sos, .kof, .dxf, .dvg, .sketchup
...