Amazon Pinpoint is an AWS service that you can use to interact and engage with your customers across different messaging platforms. In addition, this AWS service can be used to send push notifications, emails, SMS text messages, or voice messages. These are very good messaging features that application developers can use with their applications. Postman is another popular tool for testing APIs. Postman can be used to send API requests to any REST API, and also can be used to receive responses to your requests. Furthermore, Postman is a very good tool that can be used to test and troubleshoot the calls that you make to the Amazon Pinpoint API.
For more guides on AWS services you can read these: How to enable Amazon S3 default bucket encryption using S3 Console, How to deploy a .NET application to AWS Elastic Beanstalk using AWS Tool Kit, How to Deploy MVC Application to AWS EC2 Using RDP Connection and Web Deploy, How to Deploy Dynamic Website to AWS EC2, Hosting Static Website and Versioning on AWS S3, Creating IAM Users, Adding MFA and Policies on AWS, How to manage cost with AWS Budgets, How to deploy an Angular App to AWS S3.
In this guide we will be setting up Amazon Pinpoint with Postman. Before we start, make sure you have the below already setup:
- You must have an AWS account. So, to create one for yourself, go to https://console.aws.amazon.com/.
- The account that you created and use to sign into the AWS Management Console must be able to create new IAM policies and roles.
- Therefore, you must have downloaded and install Postman on your computer. You can download Postman from here Postman website.
- After installing Postman on your computer then create a Postman account that you will be using to login and carrying out your task.
In other to use Postman to test the Amazon Pinpoint API, you need to create an IAM user. Meanwhile, you can read this guide Creating IAM Users, Adding MFA and Policies on AWS
After you created the IAM user then you need to login to it and create an IAM Policy.
The next step now is to create an IAM Policy:
- Login to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/.
- Thus, in the navigation section, click Policies >> Create policy.
- On the JSON tab, paste the following code. Note that 963016309182 is the unique ID for my AWS account so you can paste yours.
- Click on Next:Review.
- Thus, on the Review Policy section, enter a name for the policy and click on Create policy.
Please note that you must provide both the access key ID and the secret access generated while creating the IAM user. It is recommended that you should copy it and save it.
The IAM user account that can access the Amazon Pinpoint API is ready, what is next is to setup the Postman.
Creating Postman environments
- So, in Postman, on the File menu, choose New.
- Afterward, on the Create New window, click on Environment.
- On the MANAGE ENVIRONMENTS window, enter the Environment Name, please enter
Amazon Pinpoint - Region Name. Furthermore, you can replace the
Region Namewith US West (Oregon)
- On the Postman create six new variables:
Please note: Never share your IAM access keys with others. Do not share your access key ID and secret access key with anybody.
When you finish creating the Postman environment, proceed to the next step of creating Amazon Pinpoint collection. A collection is a group of API requests.
In Postman, click File >> Import menu.
On the Import window, Select Link, and then enter the following in the URL: https://raw.githubusercontent.com/awsdocs/amazon-pinpoint-developer-guide/master/Amazon%20Pinpoint.postman_collection.json.
Then, click Continue to import
All the Amazon Pinpoint collections will be imported immediately you click on Import.
After importing the Amazon Pinpoint collection successfully, you can then perform a test to confirm that everything is properly configured. You can test the configuration by submitting a GetApps request which will return list of all projects in your Amazon Pinpoint account.
Let’s test our configuration of the Amazon Pinpoint collection
- from the navigation section, expand the Amazon Pinpoint collection and the the Apps folder.
- from the list of requests, select GetApps and make sure you select the environment you created earlier.
Click Send and If the request is sent successfully you should get a response with status of 200 OK.
I hope you found this blog post on How to Use Postman with the Amazon Pinpoint API very interesting and helpful. In case you have any questions do not hesitate to ask in the comment section.