Get a File

Last updated 8 months ago

get
Get a File by ID

https://api.moltin.com
/v2/files/:id
Request
Response
Path Parameters
id
required
string
The ID for the file
Headers
Authorization
required
string
The Bearer token to grant access to the API
200: OK
{
"data": {
"type": "file",
"id": "f8cf26b3-6d38-4275-937a-624a83994702",
"link": {
"href":
"https://s3-eu-west-1.amazonaws.com/bkt-svc-files-cmty-api-moltin-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,
"public": true,
"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"
}
}
}
cURL
JavaScript SDK
curl -X GET https://api.moltin.com/v2/files/:id \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
const fileId = 'XXXX'
Moltin.Files.Get(fileId).then(file => {
// Do something
})