- listConversations - List Conversations
- createConversation - Create Conversation
- getConversation - Get Conversation
- downloadMessagingAttachment - Download Attachment
- listAttachments - List Attachments
- getAttachment - Get Attachment
- listUsers - List Users
- getUser - Get User
- listConversationMessages - List Conversation Messages
- getMessage - Get Message
- sendMessage - Send Message
List Conversations
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$request = new Operations\MessagingListConversationsRequest(
xAccountId: '<id>',
fields: 'id,remote_id,participants,name,private,created_at,last_message_at,unified_custom_fields',
filter: new Operations\MessagingListConversationsQueryParamFilter(
updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
),
prefer: 'heartbeat',
);
$responses = $sdk->messaging->listConversations(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\MessagingListConversationsRequest | ✔️ | The request object to use for the request. |
?Operations\MessagingListConversationsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
Create Conversation
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$messagingCreateConversationRequestDto = new Components\MessagingCreateConversationRequestDto(
participants: [
'c28xIQ1',
'c28xIQ2',
],
name: 'Project Discussion',
private: true,
);
$response = $sdk->messaging->createConversation(
xAccountId: '<id>',
messagingCreateConversationRequestDto: $messagingCreateConversationRequestDto,
prefer: 'heartbeat'
);
if ($response->createResult !== null) {
// handle response
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
xAccountId |
string | ✔️ | The account identifier | |
messagingCreateConversationRequestDto |
Components\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 |
?Operations\MessagingCreateConversationResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
Get Conversation
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$request = new Operations\MessagingGetConversationRequest(
xAccountId: '<id>',
id: '<id>',
fields: 'id,remote_id,participants,name,private,created_at,last_message_at,unified_custom_fields',
prefer: 'heartbeat',
);
$response = $sdk->messaging->getConversation(
request: $request
);
if ($response->messagingConversationResult !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\MessagingGetConversationRequest | ✔️ | The request object to use for the request. |
?Operations\MessagingGetConversationResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
Download Attachment
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$request = new Operations\MessagingDownloadMessagingAttachmentRequest(
xAccountId: '<id>',
id: '<id>',
subResourceId: '<id>',
format: 'base64',
exportFormat: 'text/plain',
prefer: 'heartbeat',
);
$response = $sdk->messaging->downloadMessagingAttachment(
request: $request
);
if ($response->body !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\MessagingDownloadMessagingAttachmentRequest | ✔️ | The request object to use for the request. |
?Operations\MessagingDownloadMessagingAttachmentResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
List Attachments
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$request = new Operations\MessagingListAttachmentsRequest(
xAccountId: '<id>',
id: '<id>',
fields: 'id,remote_id,file_name,file_size,file_type,unified_custom_fields',
filter: new Operations\MessagingListAttachmentsQueryParamFilter(
updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
),
prefer: 'heartbeat',
);
$responses = $sdk->messaging->listAttachments(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\MessagingListAttachmentsRequest | ✔️ | The request object to use for the request. |
?Operations\MessagingListAttachmentsResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
Get Attachment
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$request = new Operations\MessagingGetAttachmentRequest(
xAccountId: '<id>',
id: '<id>',
subResourceId: '<id>',
fields: 'id,remote_id,file_name,file_size,file_type,unified_custom_fields',
prefer: 'heartbeat',
);
$response = $sdk->messaging->getAttachment(
request: $request
);
if ($response->messagingAttachmentResult !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\MessagingGetAttachmentRequest | ✔️ | The request object to use for the request. |
?Operations\MessagingGetAttachmentResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
List Users
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$request = new Operations\MessagingListUsersRequest(
xAccountId: '<id>',
fields: 'id,remote_id,email,username,name,first_name,last_name,bot,active,unified_custom_fields',
filter: new Operations\MessagingListUsersQueryParamFilter(
updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
),
prefer: 'heartbeat',
);
$responses = $sdk->messaging->listUsers(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\MessagingListUsersRequest | ✔️ | The request object to use for the request. |
?Operations\MessagingListUsersResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
Get User
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$request = new Operations\MessagingGetUserRequest(
xAccountId: '<id>',
id: '<id>',
fields: 'id,remote_id,email,username,name,first_name,last_name,bot,active,unified_custom_fields',
prefer: 'heartbeat',
);
$response = $sdk->messaging->getUser(
request: $request
);
if ($response->messagingUserResult !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\MessagingGetUserRequest | ✔️ | The request object to use for the request. |
?Operations\MessagingGetUserResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
List Conversation Messages
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$request = new Operations\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 Operations\MessagingListConversationMessagesQueryParamFilter(
updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
),
prefer: 'heartbeat',
);
$responses = $sdk->messaging->listConversationMessages(
request: $request
);
foreach ($responses as $response) {
if ($response->statusCode === 200) {
// handle response
}
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\MessagingListConversationMessagesRequest | ✔️ | The request object to use for the request. |
?Operations\MessagingListConversationMessagesResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
Get Message
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$request = new Operations\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',
);
$response = $sdk->messaging->getMessage(
request: $request
);
if ($response->messagingMessageResult !== null) {
// handle response
}| Parameter | Type | Required | Description |
|---|---|---|---|
$request |
Operations\MessagingGetMessageRequest | ✔️ | The request object to use for the request. |
?Operations\MessagingGetMessageResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |
Send Message
declare(strict_types=1);
require 'vendor/autoload.php';
use StackOne\client;
use StackOne\client\Models\Components;
$sdk = client\StackOne::builder()
->setSecurity(
new Components\Security(
username: '',
password: '',
)
)
->build();
$messagingMessageSendRequestDto = new Components\MessagingMessageSendRequestDto(
content: 'Hello, world!',
recipient: 'c28xyrc55866bvuv',
sender: '+34820398402',
);
$response = $sdk->messaging->sendMessage(
xAccountId: '<id>',
messagingMessageSendRequestDto: $messagingMessageSendRequestDto,
prefer: 'heartbeat'
);
if ($response->createResult !== null) {
// handle response
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
xAccountId |
string | ✔️ | The account identifier | |
messagingMessageSendRequestDto |
Components\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 |
?Operations\MessagingSendMessageResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\BadRequestResponse | 400 | application/json |
| Errors\UnauthorizedResponse | 401 | application/json |
| Errors\ForbiddenResponse | 403 | application/json |
| Errors\NotFoundResponse | 404 | application/json |
| Errors\RequestTimedOutResponse | 408 | application/json |
| Errors\ConflictResponse | 409 | application/json |
| Errors\PreconditionFailedResponse | 412 | application/json |
| Errors\UnprocessableEntityResponse | 422 | application/json |
| Errors\TooManyRequestsResponse | 429 | application/json |
| Errors\InternalServerErrorResponse | 500 | application/json |
| Errors\NotImplementedResponse | 501 | application/json |
| Errors\BadGatewayResponse | 502 | application/json |
| Errors\SDKException | 4XX, 5XX | */* |