CreateOmniChannel- Create Omni-Channel Template⚠️ Deprecated- CreatePush - Create Push Template
- GetPush - Get Push Template
Create Omni-Channel Template
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
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.Marketing.Templates.CreateOmniChannelAsync(
xAccountId: "<id>",
marketingCreateTemplateRequestDto: new MarketingCreateTemplateRequestDto() {
Messages = new List<CreateMessage>() {
new CreateMessage() {
Id = "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
MessageType = new CreateMessageMessageType() {
Value = CreateMessageValue.Email,
SourceValue = CreateMessageSourceValueUnion.CreateStr(
"Email"
),
},
},
},
Passthrough = new Dictionary<string, object>() {
{ "other_known_names", "John Doe" },
},
},
prefer: "heartbeat"
);
// handle response| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
XAccountId |
string | ✔️ | The account identifier | |
MarketingCreateTemplateRequestDto |
MarketingCreateTemplateRequestDto | ✔️ | 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 |
MarketingCreateOmniChannelTemplateResponse
| 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 | */* |
Create Push Template
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.Marketing.Templates.CreatePushAsync(
xAccountId: "<id>",
marketingCreatePushTemplateRequestDto: new MarketingCreatePushTemplateRequestDto() {
Messages = new List<PushMessages>() {
new PushMessages() {
Id = "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
RemoteId = "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
MessageType = new PushMessagesMessageType() {
Value = PushMessagesValue.Email,
SourceValue = PushMessagesSourceValueUnion.CreateStr(
"Email"
),
},
},
},
Passthrough = new Dictionary<string, object>() {
{ "other_known_names", "John Doe" },
},
},
prefer: "heartbeat"
);
// handle response| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
XAccountId |
string | ✔️ | The account identifier | |
MarketingCreatePushTemplateRequestDto |
MarketingCreatePushTemplateRequestDto | ✔️ | 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 |
MarketingCreatePushTemplateResponse
| 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 Push Template
using StackOneHQ.Client;
using StackOneHQ.Client.Models.Components;
using StackOneHQ.Client.Models.Requests;
var sdk = new StackOneHQClient(security: new Security() {
Username = "",
Password = "",
});
MarketingGetPushTemplateRequest req = new MarketingGetPushTemplateRequest() {
XAccountId = "<id>",
Id = "<id>",
Fields = "id,remote_id,name,messages,created_at,updated_at,tags,unified_custom_fields",
Prefer = "heartbeat",
};
var res = await sdk.Marketing.Templates.GetPushAsync(req);
// handle response| Parameter | Type | Required | Description |
|---|---|---|---|
request |
MarketingGetPushTemplateRequest | ✔️ | The request object to use for the request. |
MarketingGetPushTemplateResponse
| 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 | */* |