Store and inspect a small file while keeping it hidden until explicit Send.
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://example.com/api/workspace/collaboration/files/prepare"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new MultipartFormDataContent { new StringContent("") { Headers = { ContentType = new MediaTypeHeaderValue("application/octet-stream"), ContentDisposition = new ContentDispositionHeaderValue("form-data") { Name = "File", FileName = "file", } } }, new StringContent("example") { Headers = { ContentType = new MediaTypeHeaderValue("text/plain"), ContentDisposition = new ContentDispositionHeaderValue("form-data") { Name = "OwnerModuleKey", } } }, new StringContent("example") { Headers = { ContentType = new MediaTypeHeaderValue("text/plain"), ContentDisposition = new ContentDispositionHeaderValue("form-data") { Name = "OwnerResourceKind", } } }, new StringContent("example") { Headers = { ContentType = new MediaTypeHeaderValue("text/plain"), ContentDisposition = new ContentDispositionHeaderValue("form-data") { Name = "OwnerContextResourceId", } } }, new StringContent("example") { Headers = { ContentType = new MediaTypeHeaderValue("text/plain"), ContentDisposition = new ContentDispositionHeaderValue("form-data") { Name = "OwnerResourceObjectId", } } }, new StringContent("2489E9AD-2EE2-8E00-8EC9-32D5F69181C0") { Headers = { ContentType = new MediaTypeHeaderValue("text/plain"), ContentDisposition = new ContentDispositionHeaderValue("form-data") { Name = "OperationKey", } } }, new StringContent("example") { Headers = { ContentType = new MediaTypeHeaderValue("text/plain"), ContentDisposition = new ContentDispositionHeaderValue("form-data") { Name = "Description", } } }, },};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/collaboration/files/prepare';const form = new FormData();form.append('File', 'file');form.append('OwnerModuleKey', 'example');form.append('OwnerResourceKind', 'example');form.append('OwnerContextResourceId', 'example');form.append('OwnerResourceObjectId', 'example');form.append('OperationKey', '2489E9AD-2EE2-8E00-8EC9-32D5F69181C0');form.append('Description', 'example');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
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/collaboration/files/prepare \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form File=@file \ --form OwnerModuleKey=example \ --form OwnerResourceKind=example \ --form OwnerContextResourceId=example \ --form OwnerResourceObjectId=example \ --form OperationKey=2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --form Description=exampleAuthorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Optional access token for clients that cannot set Authorization headers. Prefer Authorization: Bearer <token> when possible.
Request Body
Section titled “Request Body”object
Responses
Section titled “Responses”OK
object
object
object
Safe committed-mutation receipt of tag, comment and attachment mutations, returned when post-state data cannot be disclosed. Entity record and responsibility mutations answer Moltaro.Package.NET.Automation.EntityRecordMutationReceipt and Moltaro.Package.NET.Automation.EntityResponsibilityMutationReceipt instead.
object
Stable logical operation identifier.
Captured completion instant of the committed operation.
object
object
object
object
object
object
object
Stable audit correlation for the committed operation.
Whether the host returned an earlier durable result without another write.
object
object
object
object
object
Example
{ "Data": null, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Invalid request. Service validation returns this error envelope; a missing request/file can return no body.
object
object
object
Safe committed-mutation receipt of tag, comment and attachment mutations, returned when post-state data cannot be disclosed. Entity record and responsibility mutations answer Moltaro.Package.NET.Automation.EntityRecordMutationReceipt and Moltaro.Package.NET.Automation.EntityResponsibilityMutationReceipt instead.
object
Stable logical operation identifier.
Captured completion instant of the committed operation.
object
object
object
object
object
object
object
Stable audit correlation for the committed operation.
Whether the host returned an earlier durable result without another write.
object
object
object
object
object
Example
{ "Data": null, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Forbidden. An authenticated policy refusal can contain this error envelope; Forbid() returns no body.
object
object
object
Safe committed-mutation receipt of tag, comment and attachment mutations, returned when post-state data cannot be disclosed. Entity record and responsibility mutations answer Moltaro.Package.NET.Automation.EntityRecordMutationReceipt and Moltaro.Package.NET.Automation.EntityResponsibilityMutationReceipt instead.
object
Stable logical operation identifier.
Captured completion instant of the committed operation.
object
object
object
object
object
object
object
Stable audit correlation for the committed operation.
Whether the host returned an earlier durable result without another write.
object
object
object
object
object
Example
{ "Data": null, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}Not Found
object
object
object
Safe committed-mutation receipt of tag, comment and attachment mutations, returned when post-state data cannot be disclosed. Entity record and responsibility mutations answer Moltaro.Package.NET.Automation.EntityRecordMutationReceipt and Moltaro.Package.NET.Automation.EntityResponsibilityMutationReceipt instead.
object
Stable logical operation identifier.
Captured completion instant of the committed operation.
object
object
object
object
object
object
object
Stable audit correlation for the committed operation.
Whether the host returned an earlier durable result without another write.
object
object
object
object
object
Example
{ "Data": null, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}The operation was refused; inspect Errors. Data may be null.
object
object
object
Safe committed-mutation receipt of tag, comment and attachment mutations, returned when post-state data cannot be disclosed. Entity record and responsibility mutations answer Moltaro.Package.NET.Automation.EntityRecordMutationReceipt and Moltaro.Package.NET.Automation.EntityResponsibilityMutationReceipt instead.
object
Stable logical operation identifier.
Captured completion instant of the committed operation.
object
object
object
object
object
object
object
Stable audit correlation for the committed operation.
Whether the host returned an earlier durable result without another write.
object
object
object
object
object
Example
{ "Data": null, "Errors": [ { "Type": 0, "Severity": 0 } ], "Warnings": [ { "Type": 0, "Severity": 0 } ]}