Download an exact attachment through a currently readable content resource.
POST
/api/workspace/attachments/{fileId}/resource-download
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://example.com/api/workspace/attachments/example/resource-download"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"ModuleKey\": \"example\", \"ResourceKind\": \"example\", \"ContextResourceId\": \"example\", \"ResourceObjectId\": \"example\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}const url = 'https://example.com/api/workspace/attachments/example/resource-download';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"ModuleKey":"example","ResourceKind":"example","ContextResourceId":"example","ResourceObjectId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/workspace/attachments/example/resource-download \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”fileId
required
string
Query Parameters
Section titled “Query Parameters”access_token
string
Optional access token for clients that cannot set Authorization headers. Prefer Authorization: Bearer <token> when possible.
Request Body
Section titled “Request Body”Stable identity of one Moltaro resource instance.
object
ModuleKey
string
ResourceKind
string
ContextResourceId
string
ResourceObjectId
string
Examplegenerated
{ "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example"}Stable identity of one Moltaro resource instance.
object
ModuleKey
string
ResourceKind
string
ContextResourceId
string
ResourceObjectId
string
Examplegenerated
{ "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example"}Stable identity of one Moltaro resource instance.
object
ModuleKey
string
ResourceKind
string
ContextResourceId
string
ResourceObjectId
string
Examplegenerated
{ "ModuleKey": "example", "ResourceKind": "example", "ContextResourceId": "example", "ResourceObjectId": "example"}Responses
Section titled “Responses”File bytes using the verified MIME type, or JSON direct-download authorization identified by X-Moltaro-Download-Authorization: 1. Do not forward the workspace token to storage.
string format: binary
string format: binary
object
Data
required
Errors
required
Array<object>
object
Code
required
string
Message
required
string
Target
string
Field
string
Metadata
object
key
additional properties
string
Type
integer format: int32
Severity
integer format: int32
Warnings
required
Array<object>
object
Code
required
string
Message
required
string
Target
string
Field
string
Metadata
object
key
additional properties
string
Type
integer format: int32
Severity
integer format: int32
Success
required
boolean
Example
{ "Data": null, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Headers
Section titled “Headers”X-Moltaro-Download-Authorization
string
Present with value 1 only for a JSON download authorization. Its absence identifies the file byte response.
Partial file bytes for an accepted Range request.
Media type*/*
string format: binary
Not Found
Media typeapplication/json
object
Data
required
Any of:
object
Descriptor
object
Id
required
string
FileName
required
string
Description
string
MimeType
required
string
StorageType
required
integer format: int32
AvailabilityState
required
integer format: int32
DetectedMimeType
string
ImageWidth
integer format: int32
ImageHeight
integer format: int32
ContentGeneration
required
integer format: int64
InspectedChecksumSha256
string
InspectedContentGeneration
integer format: int64
SizeBytes
required
integer format: int64
ChecksumSha256
required
string
CreatedAt
required
string format: date-time
ModifiedAt
string format: date-time
CreatedByUserId
string
CreatedByUserName
string
ModifiedByUserId
string
ModifiedByUserName
string
Content
string format: binary
RedirectUrl
string format: uri
RedirectExpiresAtUtc
string format: date-time
object
Errors
required
Array<object>
object
Code
required
string
Message
required
string
Target
string
Field
string
Metadata
object
key
additional properties
string
Type
integer format: int32
Severity
integer format: int32
Warnings
required
Array<object>
object
Code
required
string
Message
required
string
Target
string
Field
string
Metadata
object
key
additional properties
string
Type
integer format: int32
Severity
integer format: int32
Success
required
boolean
Example
{ "Data": null, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}