- createConversation - Create Conversation
- downloadMessagingAttachment - Download Attachment
- getAttachment - Get Attachment
- getConversation - Get Conversation
- getMessage - Get Message
- getUser - Get User
- listAttachments - List Attachments
- listConversationMessages - List Conversation Messages
- listConversations - List Conversations
- listUsers - List Users
- sendMessage - Send Message
Create Conversation
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.createConversation({
messagingCreateConversationRequestDto: {
name: "Project Discussion",
participants: [
"c28xIQ1",
"c28xIQ2",
],
private: true,
},
prefer: "heartbeat",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingCreateConversation } from "@stackone/stackone-client-ts/funcs/messagingCreateConversation.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingCreateConversation(stackOne, {
messagingCreateConversationRequestDto: {
name: "Project Discussion",
participants: [
"c28xIQ1",
"c28xIQ2",
],
private: true,
},
prefer: "heartbeat",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("messagingCreateConversation failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingCreateConversationRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |
Download Attachment
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.downloadMessagingAttachment({
exportFormat: "text/plain",
format: "base64",
id: "<id>",
subResourceId: "<id>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingDownloadMessagingAttachment } from "@stackone/stackone-client-ts/funcs/messagingDownloadMessagingAttachment.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingDownloadMessagingAttachment(stackOne, {
exportFormat: "text/plain",
format: "base64",
id: "<id>",
subResourceId: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("messagingDownloadMessagingAttachment failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingDownloadMessagingAttachmentRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |
Get Attachment
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.getAttachment({
prefer: "heartbeat",
fields: "id,remote_id,file_name,file_size,file_type,unified_custom_fields",
id: "<id>",
subResourceId: "<id>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingGetAttachment } from "@stackone/stackone-client-ts/funcs/messagingGetAttachment.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingGetAttachment(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,file_name,file_size,file_type,unified_custom_fields",
id: "<id>",
subResourceId: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("messagingGetAttachment failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingGetAttachmentRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |
Get Conversation
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.getConversation({
prefer: "heartbeat",
fields: "id,remote_id,participants,name,private,created_at,last_message_at,unified_custom_fields",
id: "<id>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingGetConversation } from "@stackone/stackone-client-ts/funcs/messagingGetConversation.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingGetConversation(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,participants,name,private,created_at,last_message_at,unified_custom_fields",
id: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("messagingGetConversation failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingGetConversationRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |
Get Message
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.getMessage({
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>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingGetMessage } from "@stackone/stackone-client-ts/funcs/messagingGetMessage.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingGetMessage(stackOne, {
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>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("messagingGetMessage failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingGetMessageRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |
Get User
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.getUser({
prefer: "heartbeat",
fields: "id,remote_id,email,username,name,first_name,last_name,bot,active,unified_custom_fields",
id: "<id>",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingGetUser } from "@stackone/stackone-client-ts/funcs/messagingGetUser.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingGetUser(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,email,username,name,first_name,last_name,bot,active,unified_custom_fields",
id: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("messagingGetUser failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingGetUserRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |
List Attachments
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.listAttachments({
prefer: "heartbeat",
fields: "id,remote_id,file_name,file_size,file_type,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
id: "<id>",
xAccountId: "<id>",
});
for await (const page of result) {
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingListAttachments } from "@stackone/stackone-client-ts/funcs/messagingListAttachments.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingListAttachments(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,file_name,file_size,file_type,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
id: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
for await (const page of result) {
console.log(page);
}
} else {
console.log("messagingListAttachments failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingListAttachmentsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |
List Conversation Messages
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.listConversationMessages({
prefer: "heartbeat",
fields: "id,remote_id,content,parent_message_id,remote_parent_message_id,attachments,author,created_at,updated_at,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
id: "<id>",
xAccountId: "<id>",
});
for await (const page of result) {
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingListConversationMessages } from "@stackone/stackone-client-ts/funcs/messagingListConversationMessages.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingListConversationMessages(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,content,parent_message_id,remote_parent_message_id,attachments,author,created_at,updated_at,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
id: "<id>",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
for await (const page of result) {
console.log(page);
}
} else {
console.log("messagingListConversationMessages failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingListConversationMessagesRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |
List Conversations
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.listConversations({
prefer: "heartbeat",
fields: "id,remote_id,participants,name,private,created_at,last_message_at,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
xAccountId: "<id>",
});
for await (const page of result) {
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingListConversations } from "@stackone/stackone-client-ts/funcs/messagingListConversations.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingListConversations(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,participants,name,private,created_at,last_message_at,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
for await (const page of result) {
console.log(page);
}
} else {
console.log("messagingListConversations failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingListConversationsRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |
List Users
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.listUsers({
prefer: "heartbeat",
fields: "id,remote_id,email,username,name,first_name,last_name,bot,active,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
xAccountId: "<id>",
});
for await (const page of result) {
console.log(page);
}
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingListUsers } from "@stackone/stackone-client-ts/funcs/messagingListUsers.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingListUsers(stackOne, {
prefer: "heartbeat",
fields: "id,remote_id,email,username,name,first_name,last_name,bot,active,unified_custom_fields",
filter: {
updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
},
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
for await (const page of result) {
console.log(page);
}
} else {
console.log("messagingListUsers failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingListUsersRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |
Send Message
import { StackOne } from "@stackone/stackone-client-ts";
const stackOne = new StackOne({
security: {
password: "",
username: "",
},
});
async function run() {
const result = await stackOne.messaging.sendMessage({
messagingMessageSendRequestDto: {
content: "Hello, world!",
recipient: "c28xyrc55866bvuv",
sender: "+34820398402",
},
prefer: "heartbeat",
xAccountId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { messagingSendMessage } from "@stackone/stackone-client-ts/funcs/messagingSendMessage.js";
// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
security: {
password: "",
username: "",
},
});
async function run() {
const res = await messagingSendMessage(stackOne, {
messagingMessageSendRequestDto: {
content: "Hello, world!",
recipient: "c28xyrc55866bvuv",
sender: "+34820398402",
},
prefer: "heartbeat",
xAccountId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("messagingSendMessage failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MessagingSendMessageRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<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.SDKError | 4XX, 5XX | */* |