Skip to main content

File

File provides access to the file resource. This can be used to get a list of files that have been uploaded.

File Properties

PropertyExampleDescription
id"7F2EE4..."Unique id of the file
fk_brand"17076B..."The id of the brand for which the file was uploaded.
fk_user"AF506D..."ID of the user who uploaded the file
fileType"product"The type of file uploaded
fileName"product_template.xlsx"The uploaded file name
createdDate"2020-08-19T09:55:59"The file creation date
status"processed"The file processing status
file_brand{related entity}The related brand details
file_user{related entity}The related user details

File Methods

GET/api/file

Returns all file records in the current user scope with all published fields.

GET Example

Example of a returned file entity
{
"response": {
"page": 1,
"pageCount": 1,
"recordsSent": 1,
"recordsFound": 1,
"file": [
{
"id": "58B4F9ED4583AC4C89829A9F22B12F9A",
"fk_brand": "CAC5F7E292107D43B939D0E3EFB76A19",
"fk_user": "AF506D3604EA124BA4537016CA22BB0D",
"fileType": "price",
"fileName": "SignatureLinePriceUpload.xlsx",
"createdDate": "2020-08-24T10:19:26",
"status": "processed",
"detail": {
"fileMime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"host": "CED75EE08F4EB94AB12C476CF09A7464",
"startDate": "2020-08-25T00:00:00.000Z",
"endDate": "0000-00-00T00:00:00.000Z",
"error": "Warning - Missing Variants: 5055950016804, 5055950017061, 5055950017085, 5055950016811, 5055950016224, 5055950017054, 5055950017078."
},
"file_brand": {
"id": "CAC5F7E292107D43B939D0E3EFB76A19",
"fk_company": "178BF5A865D4AB45B3535B56F8EF66DC",
"name": "Signature line",
"detail": null,
"code": "SIGLINE",
"brand_company": {
"__KEY": "178BF5A865D4AB45B3535B56F8EF66DC"
},
"file_user": {
"id": "AF506D3604EA124BA4537016CA22BB0D",
"name": "Leif",
"email": "jdcryer@me.com",
"type": "company",
"detail": {
"lang": "en",
"companies": [
"178BF5A865D4AB45B3535B56F8EF66DC"
]
},
"fk_sponsor": "00000000000000000000000000000000",
"fk_host": "00000000000000000000000000000000",
"fk_company": "178BF5A865D4AB45B3535B56F8EF66DC",
"fk_warehouse": "00000000000000000000000000000000"
}
}
]
}
}


POST/api/file

Parses the POST body and creates a file entry. This resource requires that the data is passed as multipart form data. In the form-data should be as follows:

Content-Disposition: form-data; name="product,<BRAND ID>"; filename="product-upload-example.xlsx"

Where product is the file type and <BRAND ID> is the id of the brand for which the file is being uploaded for. To obtain the brand id use the brand resource.

POST Examples

Example multipart file upload for product file
POST /api/file HTTP/1.1
Authorization: <API KEY>
User-Agent: PostmanRuntime/7.26.8
Accept: */*
Host: test.ilevelconnect.co.uk
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: multipart/form-data; boundary=--------------------------693598344948823053137671
Cookie: 4DSID=BBE0DED1ECE77047B723B4009754B271
Content-Length: 21892
----------------------------693598344948823053137671
Content-Disposition: form-data; name="product,<BRAND ID>"; filename="product-upload-example.xlsx"

<product-upload-example.xlsx>
----------------------------693598344948823053137671--
Example multipart file upload for stock file

The Content-Disposition for stock file uploads has an additional parameter: WAREHOUSE ID identifies the warehouse that the stock is being uploaded for. See the warehouse resource for details of how to obtain the warehouse id.

POST /api/file HTTP/1.1
Authorization: <API KEY>
User-Agent: PostmanRuntime/7.26.8
Accept: */*
Host: test.ilevelconnect.co.uk
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: multipart/form-data; boundary=--------------------------693598344948823053137671
Cookie: 4DSID=BBE0DED1ECE77047B723B4009754B271
Content-Length: 21892
----------------------------693598344948823053137671
Content-Disposition: form-data; name="stock,<BRAND ID>,<WAREHOUSE ID>"; filename="stock-upload-example.xlsx"

<stock-upload-example.xlsx>
----------------------------693598344948823053137671--
Example multipart file upload for image file
POST /api/file HTTP/1.1
Authorization: <API KEY>
User-Agent: PostmanRuntime/7.26.8
Accept: */*
Host: test.ilevelconnect.co.uk
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: multipart/form-data; boundary=--------------------------693598344948823053137671
Cookie: 4DSID=BBE0DED1ECE77047B723B4009754B271
Content-Length: 21892
----------------------------693598344948823053137671
Content-Disposition: form-data; name="image,<BRAND ID>"; filename="image-upload-example.xlsx"

<image-upload-example.xlsx>
----------------------------693598344948823053137671--
Example multipart file upload for price file

The Content-Disposition for price file uploads has additional parameters: HOST ID identifies the host that the prices are being uploaded for. See the host resource for details of how to obtain the host id.

In addition the start and end dates determine thewhen the prices should be applied and removed. End date is not required if the prices in the file are to be permanent price markdowns.

POST /api/file HTTP/1.1
Authorization: <API KEY>
User-Agent: PostmanRuntime/7.26.8
Accept: */*
Host: test.ilevelconnect.co.uk
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: multipart/form-data; boundary=--------------------------693598344948823053137671
Cookie: 4DSID=BBE0DED1ECE77047B723B4009754B271
Content-Length: 21892
----------------------------693598344948823053137671
Content-Disposition: form-data; name="price,<BRAND ID>,<HOST ID>,23/10/2021,30/10/2021"; filename="price-upload-example.xlsx"

<price-upload-example.xlsx>
----------------------------693598344948823053137671--
Example multipart file upload for an order dispatch file
POST /api/file HTTP/1.1
Authorization: <API KEY>
User-Agent: PostmanRuntime/7.26.8
Accept: */*
Host: test.ilevelconnect.co.uk
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Type: multipart/form-data; boundary=--------------------------693598344948823053137671
Cookie: 4DSID=BBE0DED1ECE77047B723B4009754B271
Content-Length: 21892
----------------------------693598344948823053137671
Content-Disposition: form-data; name="orderDispatch,<BRAND ID>"; filename="orderDispatch-upload-example.xlsx"

<orderDispatch-upload-example.xlsx>
----------------------------693598344948823053137671--