Skip to content

Latest commit

 

History

History
690 lines (535 loc) · 54.1 KB

File metadata and controls

690 lines (535 loc) · 54.1 KB

Messaging

Overview

Available Operations

create_conversation

Create Conversation

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)
res = s.messaging.create_conversation(messaging_create_conversation_request_dto: Models::Shared::MessagingCreateConversationRequestDto.new(
  name: 'Project Discussion',
  participants: [
    'c28xIQ1',
    'c28xIQ2',
  ],
  private: true
), x_account_id: '<id>', prefer: 'heartbeat')

unless res.create_result.nil?
  # handle response
end

Parameters

Parameter Type Required Description Example
messaging_create_conversation_request_dto Models::Shared::MessagingCreateConversationRequestDto ✔️ N/A
x_account_id ::String ✔️ The account identifier
prefer T.nilable(::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

T.nilable(Models::Operations::MessagingCreateConversationResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

download_messaging_attachment

Download Attachment

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::MessagingDownloadMessagingAttachmentRequest.new(
  export_format: 'text/plain',
  format: 'base64',
  id: '<id>',
  sub_resource_id: '<id>',
  x_account_id: '<id>'
)
res = s.messaging.download_messaging_attachment(request: req)

unless res.body.nil?
  # handle response
end

Parameters

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

Response

T.nilable(Models::Operations::MessagingDownloadMessagingAttachmentResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

get_attachment

Get Attachment

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::MessagingGetAttachmentRequest.new(
  prefer: 'heartbeat',
  fields_: 'id,remote_id,file_name,file_size,file_type,unified_custom_fields',
  id: '<id>',
  sub_resource_id: '<id>',
  x_account_id: '<id>'
)
res = s.messaging.get_attachment(request: req)

unless res.messaging_attachment_result.nil?
  # handle response
end

Parameters

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

Response

T.nilable(Models::Operations::MessagingGetAttachmentResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

get_conversation

Get Conversation

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::MessagingGetConversationRequest.new(
  prefer: 'heartbeat',
  fields_: 'id,remote_id,participants,name,private,created_at,last_message_at,unified_custom_fields',
  id: '<id>',
  x_account_id: '<id>'
)
res = s.messaging.get_conversation(request: req)

unless res.messaging_conversation_result.nil?
  # handle response
end

Parameters

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

Response

T.nilable(Models::Operations::MessagingGetConversationResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

get_message

Get Message

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::MessagingGetMessageRequest.new(
  prefer: 'heartbeat',
  fields_: 'id,remote_id,content,parent_message_id,remote_parent_message_id,attachments,author,created_at,updated_at,unified_custom_fields',
  id: '<id>',
  x_account_id: '<id>'
)
res = s.messaging.get_message(request: req)

unless res.messaging_message_result.nil?
  # handle response
end

Parameters

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

Response

T.nilable(Models::Operations::MessagingGetMessageResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

get_user

Get User

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::MessagingGetUserRequest.new(
  prefer: 'heartbeat',
  fields_: 'id,remote_id,email,username,name,first_name,last_name,bot,active,unified_custom_fields',
  id: '<id>',
  x_account_id: '<id>'
)
res = s.messaging.get_user(request: req)

unless res.messaging_user_result.nil?
  # handle response
end

Parameters

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

Response

T.nilable(Models::Operations::MessagingGetUserResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

list_attachments

List Attachments

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::MessagingListAttachmentsRequest.new(
  prefer: 'heartbeat',
  fields_: 'id,remote_id,file_name,file_size,file_type,unified_custom_fields',
  filter: Models::Operations::MessagingListAttachmentsQueryParamFilter.new(
    updated_after: DateTime.iso8601('2020-01-01T00:00:00.000Z')
  ),
  id: '<id>',
  x_account_id: '<id>'
)
res = s.messaging.list_attachments(request: req)

unless res.messaging_attachments_paginated.nil?
  # handle response
end

Parameters

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

Response

T.nilable(Models::Operations::MessagingListAttachmentsResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

list_conversation_messages

List Conversation Messages

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::MessagingListConversationMessagesRequest.new(
  prefer: 'heartbeat',
  fields_: 'id,remote_id,content,parent_message_id,remote_parent_message_id,attachments,author,created_at,updated_at,unified_custom_fields',
  filter: Models::Operations::MessagingListConversationMessagesQueryParamFilter.new(
    updated_after: DateTime.iso8601('2020-01-01T00:00:00.000Z')
  ),
  id: '<id>',
  x_account_id: '<id>'
)
res = s.messaging.list_conversation_messages(request: req)

unless res.messaging_messages_paginated.nil?
  # handle response
end

Parameters

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

Response

T.nilable(Models::Operations::MessagingListConversationMessagesResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

list_conversations

List Conversations

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::MessagingListConversationsRequest.new(
  prefer: 'heartbeat',
  fields_: 'id,remote_id,participants,name,private,created_at,last_message_at,unified_custom_fields',
  filter: Models::Operations::MessagingListConversationsQueryParamFilter.new(
    updated_after: DateTime.iso8601('2020-01-01T00:00:00.000Z')
  ),
  x_account_id: '<id>'
)
res = s.messaging.list_conversations(request: req)

unless res.messaging_conversations_paginated.nil?
  # handle response
end

Parameters

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

Response

T.nilable(Models::Operations::MessagingListConversationsResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

list_users

List Users

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)

req = Models::Operations::MessagingListUsersRequest.new(
  prefer: 'heartbeat',
  fields_: 'id,remote_id,email,username,name,first_name,last_name,bot,active,unified_custom_fields',
  filter: Models::Operations::MessagingListUsersQueryParamFilter.new(
    updated_after: DateTime.iso8601('2020-01-01T00:00:00.000Z')
  ),
  x_account_id: '<id>'
)
res = s.messaging.list_users(request: req)

unless res.messaging_users_paginated.nil?
  # handle response
end

Parameters

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

Response

T.nilable(Models::Operations::MessagingListUsersResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*

send_message

Send Message

Example Usage

require 'stackone_client'

Models = ::StackOne::Models
s = ::StackOne::StackOne.new(
  security: Models::Shared::Security.new(
    password: '',
    username: ''
  )
)
res = s.messaging.send_message(messaging_message_send_request_dto: Models::Shared::MessagingMessageSendRequestDto.new(
  content: 'Hello, world!',
  recipient: 'c28xyrc55866bvuv',
  sender: '+34820398402'
), x_account_id: '<id>', prefer: 'heartbeat')

unless res.create_result.nil?
  # handle response
end

Parameters

Parameter Type Required Description Example
messaging_message_send_request_dto Models::Shared::MessagingMessageSendRequestDto ✔️ N/A
x_account_id ::String ✔️ The account identifier
prefer T.nilable(::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

T.nilable(Models::Operations::MessagingSendMessageResponse)

Errors

Error Type Status Code Content Type
Models::Errors::BadRequestResponse 400 application/json
Models::Errors::UnauthorizedResponse 401 application/json
Models::Errors::ForbiddenResponse 403 application/json
Models::Errors::NotFoundResponse 404 application/json
Models::Errors::RequestTimedOutResponse 408 application/json
Models::Errors::ConflictResponse 409 application/json
Models::Errors::PreconditionFailedResponse 412 application/json
Models::Errors::UnprocessableEntityResponse 422 application/json
Models::Errors::TooManyRequestsResponse 429 application/json
Models::Errors::InternalServerErrorResponse 500 application/json
Models::Errors::NotImplementedResponse 501 application/json
Models::Errors::BadGatewayResponse 502 application/json
Errors::APIError 4XX, 5XX */*