campaigns
Creates, updates, deletes, gets or lists a campaigns resource.
Overview
| Name | campaigns |
| Type | Resource |
| Id | aws.pinpoint.campaigns |
Fields
The following fields are returned by SELECT queries:
- get_campaign
- get_campaigns
| Name | Datatype | Description |
|---|---|---|
additional_treatments | array | An array of responses, one for each treatment that you defined for the campaign, in addition to the default treatment. |
application_id | string | The unique identifier for the application that the campaign applies to. |
arn | string | The Amazon Resource Name (ARN) of the campaign. |
creation_date | string | The date, in ISO 8601 format, when the campaign was created. |
custom_delivery_configuration | object | The delivery configuration settings for sending the campaign through a custom channel. |
default_state | object | The current status of the campaign's default treatment. This value exists only for campaigns that have more than one treatment. |
description | string | The custom description of the campaign. |
holdout_percent | integer | The allocated percentage of users (segment members) who shouldn't receive messages from the campaign. |
hook | object | The settings for the AWS Lambda function to use as a code hook for the campaign. You can use this hook to customize the segment that's used by the campaign. |
id | string | The unique identifier for the campaign. |
is_paused | boolean | Specifies whether the campaign is paused. A paused campaign doesn't run unless you resume it by changing this value to false. |
last_modified_date | string | The date, in ISO 8601 format, when the campaign was last modified. |
limits | object | The messaging limits for the campaign. |
message_configuration | object | The message configuration settings for the campaign. |
name | string | The name of the campaign. |
priority | integer | Defines the priority of the campaign, used to decide the order of messages displayed to user if there are multiple messages scheduled to be displayed at the same moment. |
schedule | object | The schedule settings for the campaign. |
segment_id | string | The unique identifier for the segment that's associated with the campaign. |
segment_version | integer | The version number of the segment that's associated with the campaign. |
state | object | The current status of the campaign. |
template_configuration | object | The message template that’s used for the campaign. |
treatment_description | string | The custom description of the default treatment for the campaign. |
treatment_name | string | The custom name of the default treatment for the campaign, if the campaign has multiple treatments. A treatment is a variation of a campaign that's used for A/B testing. |
version | integer | The version number of the campaign. |
tags | object | A string-to-string map of key-value pairs that identifies the tags that are associated with the campaign. Each tag consists of a required tag key and an associated tag value. |
| Name | Datatype | Description |
|---|---|---|
item | array | An array of responses, one for each campaign that's associated with the application. |
next_token | string | The string to use in a subsequent request to get the next page of results in a paginated response. This value is null if there are no additional pages. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_campaign | select | application-id, campaign-id, region | Retrieves information about the status, configuration, and other settings for a campaign. | |
get_campaigns | select | application-id, region | page-size, token | Retrieves information about the status, configuration, and other settings for all the campaigns that are associated with an application. |
create_campaign | insert | application-id, region, WriteCampaignRequest | Creates a new campaign for an application or updates the settings of an existing campaign for an application. | |
update_campaign | update | application-id, campaign-id, region, WriteCampaignRequest | Updates the configuration and other settings for a campaign. | |
delete_campaign | delete | application-id, campaign-id, region | Deletes a campaign from an application. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
application-id | string | The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console. |
campaign-id | string | The unique identifier for the campaign. |
region | string | AWS region (default: us-east-1) |
page-size | string | The maximum number of items to include in each page of a paginated response. This parameter is not supported for application, campaign, and journey metrics. |
token | string | The NextToken string that specifies which page of results to return in a paginated response. |
SELECT examples
- get_campaign
- get_campaigns
Retrieves information about the status, configuration, and other settings for a campaign.
SELECT
additional_treatments,
application_id,
arn,
creation_date,
custom_delivery_configuration,
default_state,
description,
holdout_percent,
hook,
id,
is_paused,
last_modified_date,
limits,
message_configuration,
name,
priority,
schedule,
segment_id,
segment_version,
state,
template_configuration,
treatment_description,
treatment_name,
version,
tags
FROM aws.pinpoint.campaigns
WHERE `application-id` = '{{ application-id }}' -- required
AND `campaign-id` = '{{ campaign-id }}' -- required
AND region = '{{ region }}' -- required
;
Retrieves information about the status, configuration, and other settings for all the campaigns that are associated with an application.
SELECT
item,
next_token
FROM aws.pinpoint.campaigns
WHERE `application-id` = '{{ application-id }}' -- required
AND region = '{{ region }}' -- required
AND `page-size` = '{{ page-size }}'
AND token = '{{ token }}'
;
INSERT examples
- create_campaign
- Manifest
Creates a new campaign for an application or updates the settings of an existing campaign for an application.
INSERT INTO aws.pinpoint.campaigns (
WriteCampaignRequest,
`application-id`,
region
)
SELECT
'{{ WriteCampaignRequest }}' /* required */,
'{{ application-id }}',
'{{ region }}'
RETURNING
campaign_response
;
# Description fields are for documentation purposes
- name: campaigns
props:
- name: application-id
value: "{{ application-id }}"
description: Required parameter for the campaigns resource.
- name: region
value: "{{ region }}"
description: Required parameter for the campaigns resource.
- name: WriteCampaignRequest
description: |
Specifies the configuration and other settings for a campaign.
value:
AdditionalTreatments:
- CustomDeliveryConfiguration:
DeliveryUri: "{{ DeliveryUri }}"
EndpointTypes:
- "{{ EndpointTypes }}"
MessageConfiguration:
ADMMessage:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageSmallIconUrl: "{{ ImageSmallIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
JsonBody: "{{ JsonBody }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
SilentPush: {{ SilentPush }}
TimeToLive: {{ TimeToLive }}
Title: "{{ Title }}"
Url: "{{ Url }}"
APNSMessage:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageSmallIconUrl: "{{ ImageSmallIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
JsonBody: "{{ JsonBody }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
SilentPush: {{ SilentPush }}
TimeToLive: {{ TimeToLive }}
Title: "{{ Title }}"
Url: "{{ Url }}"
BaiduMessage:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageSmallIconUrl: "{{ ImageSmallIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
JsonBody: "{{ JsonBody }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
SilentPush: {{ SilentPush }}
TimeToLive: {{ TimeToLive }}
Title: "{{ Title }}"
Url: "{{ Url }}"
CustomMessage:
Data: "{{ Data }}"
DefaultMessage:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageSmallIconUrl: "{{ ImageSmallIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
JsonBody: "{{ JsonBody }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
SilentPush: {{ SilentPush }}
TimeToLive: {{ TimeToLive }}
Title: "{{ Title }}"
Url: "{{ Url }}"
EmailMessage:
Body: "{{ Body }}"
FromAddress: "{{ FromAddress }}"
Headers:
- Name: "{{ Name }}"
Value: "{{ Value }}"
HtmlBody: "{{ HtmlBody }}"
Title: "{{ Title }}"
GCMMessage:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageSmallIconUrl: "{{ ImageSmallIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
JsonBody: "{{ JsonBody }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
SilentPush: {{ SilentPush }}
TimeToLive: {{ TimeToLive }}
Title: "{{ Title }}"
Url: "{{ Url }}"
SMSMessage:
Body: "{{ Body }}"
MessageType: "{{ MessageType }}"
OriginationNumber: "{{ OriginationNumber }}"
SenderId: "{{ SenderId }}"
EntityId: "{{ EntityId }}"
TemplateId: "{{ TemplateId }}"
InAppMessage:
Body: "{{ Body }}"
Content:
- BackgroundColor: "{{ BackgroundColor }}"
BodyConfig:
Alignment: "{{ Alignment }}"
Body: "{{ Body }}"
TextColor: "{{ TextColor }}"
HeaderConfig:
Alignment: "{{ Alignment }}"
Header: "{{ Header }}"
TextColor: "{{ TextColor }}"
ImageUrl: "{{ ImageUrl }}"
PrimaryBtn:
Android: "{{ Android }}"
DefaultConfig: "{{ DefaultConfig }}"
IOS: "{{ IOS }}"
Web: "{{ Web }}"
SecondaryBtn:
Android: "{{ Android }}"
DefaultConfig: "{{ DefaultConfig }}"
IOS: "{{ IOS }}"
Web: "{{ Web }}"
CustomConfig: "{{ CustomConfig }}"
Layout: "{{ Layout }}"
Schedule:
EndTime: "{{ EndTime }}"
EventFilter:
Dimensions:
Attributes: "{{ Attributes }}"
EventType: "{{ EventType }}"
Metrics: "{{ Metrics }}"
FilterType: "{{ FilterType }}"
Frequency: "{{ Frequency }}"
IsLocalTime: {{ IsLocalTime }}
QuietTime:
End: "{{ End }}"
Start: "{{ Start }}"
StartTime: "{{ StartTime }}"
Timezone: "{{ Timezone }}"
SizePercent: {{ SizePercent }}
TemplateConfiguration:
EmailTemplate:
Name: "{{ Name }}"
Version: "{{ Version }}"
PushTemplate:
Name: "{{ Name }}"
Version: "{{ Version }}"
SMSTemplate:
Name: "{{ Name }}"
Version: "{{ Version }}"
VoiceTemplate:
Name: "{{ Name }}"
Version: "{{ Version }}"
InAppTemplate:
Name: "{{ Name }}"
Version: "{{ Version }}"
TreatmentDescription: "{{ TreatmentDescription }}"
TreatmentName: "{{ TreatmentName }}"
CustomDeliveryConfiguration:
DeliveryUri: "{{ DeliveryUri }}"
EndpointTypes:
- "{{ EndpointTypes }}"
Description: "{{ Description }}"
HoldoutPercent: {{ HoldoutPercent }}
Hook:
LambdaFunctionName: "{{ LambdaFunctionName }}"
Mode: "{{ Mode }}"
WebUrl: "{{ WebUrl }}"
IsPaused: {{ IsPaused }}
Limits:
Daily: {{ Daily }}
MaximumDuration: {{ MaximumDuration }}
MessagesPerSecond: {{ MessagesPerSecond }}
Total: {{ Total }}
Session: {{ Session }}
MessageConfiguration:
ADMMessage:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageSmallIconUrl: "{{ ImageSmallIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
JsonBody: "{{ JsonBody }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
SilentPush: {{ SilentPush }}
TimeToLive: {{ TimeToLive }}
Title: "{{ Title }}"
Url: "{{ Url }}"
APNSMessage:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageSmallIconUrl: "{{ ImageSmallIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
JsonBody: "{{ JsonBody }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
SilentPush: {{ SilentPush }}
TimeToLive: {{ TimeToLive }}
Title: "{{ Title }}"
Url: "{{ Url }}"
BaiduMessage:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageSmallIconUrl: "{{ ImageSmallIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
JsonBody: "{{ JsonBody }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
SilentPush: {{ SilentPush }}
TimeToLive: {{ TimeToLive }}
Title: "{{ Title }}"
Url: "{{ Url }}"
CustomMessage:
Data: "{{ Data }}"
DefaultMessage:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageSmallIconUrl: "{{ ImageSmallIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
JsonBody: "{{ JsonBody }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
SilentPush: {{ SilentPush }}
TimeToLive: {{ TimeToLive }}
Title: "{{ Title }}"
Url: "{{ Url }}"
EmailMessage:
Body: "{{ Body }}"
FromAddress: "{{ FromAddress }}"
Headers:
- Name: "{{ Name }}"
Value: "{{ Value }}"
HtmlBody: "{{ HtmlBody }}"
Title: "{{ Title }}"
GCMMessage:
Action: "{{ Action }}"
Body: "{{ Body }}"
ImageIconUrl: "{{ ImageIconUrl }}"
ImageSmallIconUrl: "{{ ImageSmallIconUrl }}"
ImageUrl: "{{ ImageUrl }}"
JsonBody: "{{ JsonBody }}"
MediaUrl: "{{ MediaUrl }}"
RawContent: "{{ RawContent }}"
SilentPush: {{ SilentPush }}
TimeToLive: {{ TimeToLive }}
Title: "{{ Title }}"
Url: "{{ Url }}"
SMSMessage:
Body: "{{ Body }}"
MessageType: "{{ MessageType }}"
OriginationNumber: "{{ OriginationNumber }}"
SenderId: "{{ SenderId }}"
EntityId: "{{ EntityId }}"
TemplateId: "{{ TemplateId }}"
InAppMessage:
Body: "{{ Body }}"
Content:
- BackgroundColor: "{{ BackgroundColor }}"
BodyConfig:
Alignment: "{{ Alignment }}"
Body: "{{ Body }}"
TextColor: "{{ TextColor }}"
HeaderConfig:
Alignment: "{{ Alignment }}"
Header: "{{ Header }}"
TextColor: "{{ TextColor }}"
ImageUrl: "{{ ImageUrl }}"
PrimaryBtn:
Android: "{{ Android }}"
DefaultConfig: "{{ DefaultConfig }}"
IOS: "{{ IOS }}"
Web: "{{ Web }}"
SecondaryBtn:
Android: "{{ Android }}"
DefaultConfig: "{{ DefaultConfig }}"
IOS: "{{ IOS }}"
Web: "{{ Web }}"
CustomConfig: "{{ CustomConfig }}"
Layout: "{{ Layout }}"
Name: "{{ Name }}"
Schedule:
EndTime: "{{ EndTime }}"
EventFilter:
Dimensions:
Attributes: "{{ Attributes }}"
EventType:
DimensionType: "{{ DimensionType }}"
Values: "{{ Values }}"
Metrics: "{{ Metrics }}"
FilterType: "{{ FilterType }}"
Frequency: "{{ Frequency }}"
IsLocalTime: {{ IsLocalTime }}
QuietTime:
End: "{{ End }}"
Start: "{{ Start }}"
StartTime: "{{ StartTime }}"
Timezone: "{{ Timezone }}"
SegmentId: "{{ SegmentId }}"
SegmentVersion: {{ SegmentVersion }}
tags: "{{ tags }}"
TemplateConfiguration:
EmailTemplate:
Name: "{{ Name }}"
Version: "{{ Version }}"
PushTemplate:
Name: "{{ Name }}"
Version: "{{ Version }}"
SMSTemplate:
Name: "{{ Name }}"
Version: "{{ Version }}"
VoiceTemplate:
Name: "{{ Name }}"
Version: "{{ Version }}"
InAppTemplate:
Name: "{{ Name }}"
Version: "{{ Version }}"
TreatmentDescription: "{{ TreatmentDescription }}"
TreatmentName: "{{ TreatmentName }}"
Priority: {{ Priority }}
UPDATE examples
- update_campaign
Updates the configuration and other settings for a campaign.
UPDATE aws.pinpoint.campaigns
SET
WriteCampaignRequest = '{{ WriteCampaignRequest }}'
WHERE
`application-id` = '{{ application-id }}' --required
AND `campaign-id` = '{{ campaign-id }}' --required
AND region = '{{ region }}' --required
AND WriteCampaignRequest = '{{ WriteCampaignRequest }}' --required
RETURNING
campaign_response;
DELETE examples
- delete_campaign
Deletes a campaign from an application.
DELETE FROM aws.pinpoint.campaigns
WHERE `application-id` = '{{ application-id }}' --required
AND `campaign-id` = '{{ campaign-id }}' --required
AND region = '{{ region }}' --required
;