Download File
using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;
var sdk = new StackOneHQClient(security: new Security() {
Username = "",
Password = "",
});
DocumentsDownloadFileRequest req = new DocumentsDownloadFileRequest() {
XAccountId = "<id>",
Id = "<id>",
Format = "base64",
ExportFormat = "text/plain",
Prefer = "heartbeat",
};
var res = await sdk.Documents.Files.DownloadAsync(req);
// handle response
DocumentsDownloadFileResponse
| Error Type |
Status Code |
Content Type |
| StackOneHQ.Client.Models.Errors.BadRequestResponseException |
400 |
application/json |
| StackOneHQ.Client.Models.Errors.UnauthorizedResponseException |
401 |
application/json |
| StackOneHQ.Client.Models.Errors.ForbiddenResponseException |
403 |
application/json |
| StackOneHQ.Client.Models.Errors.NotFoundResponseException |
404 |
application/json |
| StackOneHQ.Client.Models.Errors.RequestTimedOutResponseException |
408 |
application/json |
| StackOneHQ.Client.Models.Errors.ConflictResponseException |
409 |
application/json |
| StackOneHQ.Client.Models.Errors.PreconditionFailedResponseException |
412 |
application/json |
| StackOneHQ.Client.Models.Errors.UnprocessableEntityResponseException |
422 |
application/json |
| StackOneHQ.Client.Models.Errors.TooManyRequestsResponseException |
429 |
application/json |
| StackOneHQ.Client.Models.Errors.InternalServerErrorResponse |
500 |
application/json |
| StackOneHQ.Client.Models.Errors.NotImplementedResponseException |
501 |
application/json |
| StackOneHQ.Client.Models.Errors.BadGatewayResponseException |
502 |
application/json |
| StackOneHQ.Client.Models.Errors.APIException |
4XX, 5XX |
*/* |
List Files
using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;
using System;
var sdk = new StackOneHQClient(security: new Security() {
Username = "",
Password = "",
});
DocumentsListFilesRequest req = new DocumentsListFilesRequest() {
XAccountId = "<id>",
Fields = "id,remote_id,name,description,url,size,file_format,path,owner_id,remote_owner_id,folder_id,remote_folder_id,drive_id,remote_drive_id,export_formats,default_download_format,created_at,updated_at,has_content,has_children,all_parent_folder_ids,remote_all_parent_folder_ids,unified_custom_fields",
Filter = new DocumentsListFilesFilter() {
UpdatedAfter = System.DateTime.Parse("2020-01-01T00:00:00.000Z"),
Name = "john_doe_resume.pdf",
Content = "FAQ of the project",
CreatedAfter = System.DateTime.Parse("2020-01-01T00:00:00.000Z"),
DriveId = "1234567890",
FolderId = "1234567890",
},
FolderId = "1234567890",
NestedItems = "true",
Include = "all_parent_folder_ids",
Prefer = "heartbeat",
};
DocumentsListFilesResponse? res = await sdk.Documents.Files.ListAsync(req);
while(res != null)
{
// handle items
res = await res.Next!();
}
DocumentsListFilesResponse
| Error Type |
Status Code |
Content Type |
| StackOneHQ.Client.Models.Errors.BadRequestResponseException |
400 |
application/json |
| StackOneHQ.Client.Models.Errors.UnauthorizedResponseException |
401 |
application/json |
| StackOneHQ.Client.Models.Errors.ForbiddenResponseException |
403 |
application/json |
| StackOneHQ.Client.Models.Errors.NotFoundResponseException |
404 |
application/json |
| StackOneHQ.Client.Models.Errors.RequestTimedOutResponseException |
408 |
application/json |
| StackOneHQ.Client.Models.Errors.ConflictResponseException |
409 |
application/json |
| StackOneHQ.Client.Models.Errors.PreconditionFailedResponseException |
412 |
application/json |
| StackOneHQ.Client.Models.Errors.UnprocessableEntityResponseException |
422 |
application/json |
| StackOneHQ.Client.Models.Errors.TooManyRequestsResponseException |
429 |
application/json |
| StackOneHQ.Client.Models.Errors.InternalServerErrorResponse |
500 |
application/json |
| StackOneHQ.Client.Models.Errors.NotImplementedResponseException |
501 |
application/json |
| StackOneHQ.Client.Models.Errors.BadGatewayResponseException |
502 |
application/json |
| StackOneHQ.Client.Models.Errors.APIException |
4XX, 5XX |
*/* |
Get File
using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;
var sdk = new StackOneHQClient(security: new Security() {
Username = "",
Password = "",
});
DocumentsGetFileRequest req = new DocumentsGetFileRequest() {
XAccountId = "<id>",
Id = "<id>",
Fields = "id,remote_id,name,description,url,size,file_format,path,owner_id,remote_owner_id,folder_id,remote_folder_id,drive_id,remote_drive_id,export_formats,default_download_format,created_at,updated_at,has_content,has_children,all_parent_folder_ids,remote_all_parent_folder_ids,unified_custom_fields",
Include = "all_parent_folder_ids",
Prefer = "heartbeat",
};
var res = await sdk.Documents.Files.GetAsync(req);
// handle response
DocumentsGetFileResponse
| Error Type |
Status Code |
Content Type |
| StackOneHQ.Client.Models.Errors.BadRequestResponseException |
400 |
application/json |
| StackOneHQ.Client.Models.Errors.UnauthorizedResponseException |
401 |
application/json |
| StackOneHQ.Client.Models.Errors.ForbiddenResponseException |
403 |
application/json |
| StackOneHQ.Client.Models.Errors.NotFoundResponseException |
404 |
application/json |
| StackOneHQ.Client.Models.Errors.RequestTimedOutResponseException |
408 |
application/json |
| StackOneHQ.Client.Models.Errors.ConflictResponseException |
409 |
application/json |
| StackOneHQ.Client.Models.Errors.PreconditionFailedResponseException |
412 |
application/json |
| StackOneHQ.Client.Models.Errors.UnprocessableEntityResponseException |
422 |
application/json |
| StackOneHQ.Client.Models.Errors.TooManyRequestsResponseException |
429 |
application/json |
| StackOneHQ.Client.Models.Errors.InternalServerErrorResponse |
500 |
application/json |
| StackOneHQ.Client.Models.Errors.NotImplementedResponseException |
501 |
application/json |
| StackOneHQ.Client.Models.Errors.BadGatewayResponseException |
502 |
application/json |
| StackOneHQ.Client.Models.Errors.APIException |
4XX, 5XX |
*/* |