Get file metadata
GET
/v1/files/{file_id}
const url = 'http://127.0.0.1:8000/v1/files/example';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://127.0.0.1:8000/v1/files/exampleRetrieve metadata for one stored file without returning its content.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”file_id
required
File Id
Immutable file identifier.
string
Immutable file identifier.
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
FileResponse
Metadata for a file stored by ParseHawk.
object
id
required
Id
Immutable file identifier.
string
file_name
required
File Name
Original upload filename.
string
content_type
required
Content Type
Detected or supplied media type.
string
size_bytes
required
Size Bytes
Stored file size in bytes.
integer
sha256
required
Sha256
Lowercase SHA-256 digest of the stored bytes.
string
source
required
FileSource
How the file entered ParseHawk.
string
is_example
required
Is Example
Whether the file ships as a built-in example.
boolean
created_at
required
Created At
UTC creation time.
string format: date-time
Example
{ "id": "file_01JZ6QK8M7", "file_name": "invoice.pdf", "content_type": "application/pdf", "source": "user"}The requested ParseHawk resource does not exist.
Media typeapplication/json
ApiErrorResponse
Error returned by request validation or a ParseHawk domain service.
object
detail
required
Any of:
string
Array<object>
object
key
additional properties
any
Examplegenerated
{ "detail": [ {} ]}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}Unexpected server error.
Media typeapplication/json
ApiErrorResponse
Error returned by request validation or a ParseHawk domain service.
object
detail
required
Any of:
string
Array<object>
object
key
additional properties
any
Examplegenerated
{ "detail": [ {} ]}