Skip to content

Latest commit

 

History

History
691 lines (532 loc) · 64.3 KB

File metadata and controls

691 lines (532 loc) · 64.3 KB

Messaging

Overview

Available Operations

ListConversations

List Conversations

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;
using System;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

MessagingListConversationsRequest req = new MessagingListConversationsRequest() {
    XAccountId = "<id>",
    Fields = "id,remote_id,participants,name,private,created_at,last_message_at,unified_custom_fields",
    Filter = new MessagingListConversationsFilter() {
        UpdatedAfter = System.DateTime.Parse("2020-01-01T00:00:00.000Z"),
    },
    Prefer = "heartbeat",
};

MessagingListConversationsResponse? res = await sdk.Messaging.ListConversationsAsync(req);

while(res != null)
{
    // handle items

    res = await res.Next!();
}

Parameters

Parameter Type Required Description
request MessagingListConversationsRequest ✔️ The request object to use for the request.

Response

MessagingListConversationsResponse

Errors

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 */*

CreateConversation

Create Conversation

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using System.Collections.Generic;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

var res = await sdk.Messaging.CreateConversationAsync(
    xAccountId: "<id>",
    messagingCreateConversationRequestDto: new MessagingCreateConversationRequestDto() {
        Participants = new List<string>() {
            "c28xIQ1",
            "c28xIQ2",
        },
        Name = "Project Discussion",
        Private = MessagingCreateConversationRequestDtoPrivateUnion.CreateBoolean(
            true
        ),
    },
    prefer: "heartbeat"
);

// handle response

Parameters

Parameter Type Required Description Example
XAccountId string ✔️ The account identifier
MessagingCreateConversationRequestDto MessagingCreateConversationRequestDto ✔️ N/A
Prefer string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

MessagingCreateConversationResponse

Errors

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 */*

GetConversation

Get Conversation

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

MessagingGetConversationRequest req = new MessagingGetConversationRequest() {
    XAccountId = "<id>",
    Id = "<id>",
    Fields = "id,remote_id,participants,name,private,created_at,last_message_at,unified_custom_fields",
    Prefer = "heartbeat",
};

var res = await sdk.Messaging.GetConversationAsync(req);

// handle response

Parameters

Parameter Type Required Description
request MessagingGetConversationRequest ✔️ The request object to use for the request.

Response

MessagingGetConversationResponse

Errors

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 */*

DownloadMessagingAttachment

Download Attachment

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

MessagingDownloadMessagingAttachmentRequest req = new MessagingDownloadMessagingAttachmentRequest() {
    XAccountId = "<id>",
    Id = "<id>",
    SubResourceId = "<id>",
    Format = "base64",
    ExportFormat = "text/plain",
    Prefer = "heartbeat",
};

var res = await sdk.Messaging.DownloadMessagingAttachmentAsync(req);

// handle response

Parameters

Parameter Type Required Description
request MessagingDownloadMessagingAttachmentRequest ✔️ The request object to use for the request.

Response

MessagingDownloadMessagingAttachmentResponse

Errors

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 */*

ListAttachments

List Attachments

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;
using System;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

MessagingListAttachmentsRequest req = new MessagingListAttachmentsRequest() {
    XAccountId = "<id>",
    Id = "<id>",
    Fields = "id,remote_id,file_name,file_size,file_type,unified_custom_fields",
    Filter = new MessagingListAttachmentsFilter() {
        UpdatedAfter = System.DateTime.Parse("2020-01-01T00:00:00.000Z"),
    },
    Prefer = "heartbeat",
};

MessagingListAttachmentsResponse? res = await sdk.Messaging.ListAttachmentsAsync(req);

while(res != null)
{
    // handle items

    res = await res.Next!();
}

Parameters

Parameter Type Required Description
request MessagingListAttachmentsRequest ✔️ The request object to use for the request.

Response

MessagingListAttachmentsResponse

Errors

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 */*

GetAttachment

Get Attachment

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

MessagingGetAttachmentRequest req = new MessagingGetAttachmentRequest() {
    XAccountId = "<id>",
    Id = "<id>",
    SubResourceId = "<id>",
    Fields = "id,remote_id,file_name,file_size,file_type,unified_custom_fields",
    Prefer = "heartbeat",
};

var res = await sdk.Messaging.GetAttachmentAsync(req);

// handle response

Parameters

Parameter Type Required Description
request MessagingGetAttachmentRequest ✔️ The request object to use for the request.

Response

MessagingGetAttachmentResponse

Errors

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 */*

ListUsers

List Users

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;
using System;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

MessagingListUsersRequest req = new MessagingListUsersRequest() {
    XAccountId = "<id>",
    Fields = "id,remote_id,email,username,name,first_name,last_name,bot,active,unified_custom_fields",
    Filter = new MessagingListUsersFilter() {
        UpdatedAfter = System.DateTime.Parse("2020-01-01T00:00:00.000Z"),
    },
    Prefer = "heartbeat",
};

MessagingListUsersResponse? res = await sdk.Messaging.ListUsersAsync(req);

while(res != null)
{
    // handle items

    res = await res.Next!();
}

Parameters

Parameter Type Required Description
request MessagingListUsersRequest ✔️ The request object to use for the request.

Response

MessagingListUsersResponse

Errors

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 */*

GetUser

Get User

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

MessagingGetUserRequest req = new MessagingGetUserRequest() {
    XAccountId = "<id>",
    Id = "<id>",
    Fields = "id,remote_id,email,username,name,first_name,last_name,bot,active,unified_custom_fields",
    Prefer = "heartbeat",
};

var res = await sdk.Messaging.GetUserAsync(req);

// handle response

Parameters

Parameter Type Required Description
request MessagingGetUserRequest ✔️ The request object to use for the request.

Response

MessagingGetUserResponse

Errors

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 */*

ListConversationMessages

List Conversation Messages

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;
using System;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

MessagingListConversationMessagesRequest req = new MessagingListConversationMessagesRequest() {
    XAccountId = "<id>",
    Id = "<id>",
    Fields = "id,remote_id,content,parent_message_id,remote_parent_message_id,attachments,author,created_at,updated_at,unified_custom_fields",
    Filter = new MessagingListConversationMessagesFilter() {
        UpdatedAfter = System.DateTime.Parse("2020-01-01T00:00:00.000Z"),
    },
    Prefer = "heartbeat",
};

MessagingListConversationMessagesResponse? res = await sdk.Messaging.ListConversationMessagesAsync(req);

while(res != null)
{
    // handle items

    res = await res.Next!();
}

Parameters

Parameter Type Required Description
request MessagingListConversationMessagesRequest ✔️ The request object to use for the request.

Response

MessagingListConversationMessagesResponse

Errors

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 */*

GetMessage

Get Message

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

MessagingGetMessageRequest req = new MessagingGetMessageRequest() {
    XAccountId = "<id>",
    Id = "<id>",
    Fields = "id,remote_id,content,parent_message_id,remote_parent_message_id,attachments,author,created_at,updated_at,unified_custom_fields",
    Prefer = "heartbeat",
};

var res = await sdk.Messaging.GetMessageAsync(req);

// handle response

Parameters

Parameter Type Required Description
request MessagingGetMessageRequest ✔️ The request object to use for the request.

Response

MessagingGetMessageResponse

Errors

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 */*

SendMessage

Send Message

Example Usage

using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;

var sdk = new StackOneHQClient(security: new Security() {
    Username = "",
    Password = "",
});

var res = await sdk.Messaging.SendMessageAsync(
    xAccountId: "<id>",
    messagingMessageSendRequestDto: new MessagingMessageSendRequestDto() {
        Content = "Hello, world!",
        Recipient = "c28xyrc55866bvuv",
        Sender = "+34820398402",
    },
    prefer: "heartbeat"
);

// handle response

Parameters

Parameter Type Required Description Example
XAccountId string ✔️ The account identifier
MessagingMessageSendRequestDto MessagingMessageSendRequestDto ✔️ N/A
Prefer string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

MessagingSendMessageResponse

Errors

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 */*