Get all Files
GET
Get all Files
https://api.moltin.com/v2/files
Filtering
You can filter results returned from the API using a standard URI format.
Supported operators and attributes
The following attributes and operators are supported.
Operator | Attribute | Description |
---|---|---|
eq | file_name , file_location | Equals. Checks the file_name and file_location match. If they are, a list of files that equal the specified file_name and file_location are returned. |
in | id | In. Returns a list of specified file IDs so you can return a batch of specific files in a single request. If they are, the condition is true. Wildcards are not supported. For example, https://api.moltin.com/v2/files?filter=in(id,83686d9f-2a7c-4444-84f1-8087d30fa60c,6dccecc2-5b28-44d5-82fe-bb3576fd93f9,3f134fd5-bd10-4060-9115-267c23ed604b . |
You can use pagination with this resource. For more information, see pagination.
Parameters
Headers
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token required to get access to the API. |
Query parameters
Name | Required | Type | Description |
---|---|---|---|
filter | Optional | string | Filter attributes. For more information, see Filtering files. |
Request Examples
Curl
curl -X GET https://api.moltin.com/v2/files \
-H "Authorization: Bearer XXXX"
JavaScript SDK
await Moltin.Files.All();
Response Example
200 OK
{
"data": [
{
"type": "file",
"id": "f8cf26b3-6d38-4275-937a-624a83994702",
"link": {
"href": "https://files-eu.epusercontent.com/e8c53cb0-120d-4ea5-8941-ce74dec06038/f8cf26b3-6d38-4275-937a-624a83994702.png"
},
"file_name": "f6669358-85db-4367-9cde-1deb77acb5f4.png",
"mime_type": "image/png",
"file_size": 110041,
"meta": {
"dimensions": {
"width": 1000,
"height": 1000
},
"timestamps": {
"created_at": "2018-03-13T13:45:21.673Z"
}
},
"links": {
"self": "https://api.moltin.com/v2/files/f8cf26b3-6d38-4275-937a-624a83994702"
}
}
],
"links": {
"self": "https://api.moltin.com/v2/files?page[offset]=0&page[limit]=100&filter=",
"first": "https://api.moltin.com/v2/files?page[offset]=0&page[limit]=100&filter=",
"last": null
},
"meta": {
"page": {
"limit": 100,
"offset": 0,
"current": 1,
"total": 1
},
"results": {
"total": 1
}
}
}