Amazon Personalize
Developer Guide

This is prerelease documentation for a service in preview release. It is subject to change.

We made breaking changes to the Amazon Personalize API and service model on 02/20/19. To continue using Amazon Personalize with the AWS Command Line Interface or AWS SDK for Python (Boto 3), update your service JSON files by doing steps 3-6 of Setting Up the AWS CLI.

Creating a Campaign

You create a campaign by deploying a solution. You can create and update a campaign by using the AWS console or by using the AWS SDK.

To create a campaign with the SDK call CreateCampaign and pass the following:

  • A name for the campaign.

  • The Amazon Resource Name (ARN) of the solution to deploy.

  • An update mode.

If the update mode is AUTO, the latest version of the solution is automatically deployed whenever the solution is updated. If it is MANUAL, the campaign must be manually updated by calling UpdateCampaign. If you want to create a campaign using a specific version of a solution, specify the optional SolutionVersionArn input parameter.

To create a campaign

  1. Create a solution to deploy. For more information, see Creating a Solution.

  2. Use the following code to create a campaign.

    import boto3 if __name__ == "__main__": personalize = boto3.client('personalize', region_name='us-west-2') response=personalize.create_campaign( name='PythonCampaign', solutionArn='Solution arn', updateMode='AUTO' ) arn=response['campaignArn'] description=personalize.describe_campaign(campaignArn=arn)['campaign'] print('Name: ' + description['name']) print('ARN: ' + description['campaignArn']) print('Status: ' + description['status'])

The campaign isn't ready for use until its status is active. To get the current status, call DescribeCampaign and check that the status field is ACTIVE.

Amazon Personalize provides operations for managing campaigns such as ListCampaigns to list the campaigns you have created. You can delete a campaign by calling DeleteCampaign. If you delete a campaign, the solutions that are part of the campaign are not deleted.

After you have created your campaign, your deployed solution is able to make recommendations. For more information, see Getting Recommendations.