AWS/Azure/OpenShift

How to Use Postman with the Amazon Pinpoint API

image-12

Amazon Pinpoint is an AWS service that you can use to interact and engage with your customers across different messaging platforms. 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. 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. 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.
  • 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 and 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:

image
Identity and Access Management
  • On the JSON tab, paste the following code. Note that 963016309182 is the unique ID for my AWS account so you can paste yours.
image-1
Policy in JSON

Continue……..

image-2
Policy in JSON
  • Click on Next:Review.
  • On the Review Policy section, enter a name for the policy and click on Create policy.
image-3
Review Policy

Policy created

image-4
Policy Created

Please note that you will need to provide both the access key ID and the secret access generated while you were 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

  • In Postman, on the File menu, choose New.
  • On the Create New window, click on Environment.
image-5
Postman Environment
  • On the MANAGE ENVIRONMENTS window, enter the Environment Name, please enter Amazon Pinpoint - Region Name. You can replace the Region Name with US West (Oregon)
  • On the Postman create six new variables: 
  • Endpoint
  • Region
  • serviceName
  • accountId
  • accessKey
  • secretAccessKey
image-6
Postman Workspace

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.

Click Continue to import

image-7
Importing Amazon Pinpoint Collections

All the Amazon Pinpoint collections will be imported immediately you click on Import.

image-8
Importing

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.
image-9
Sending your API request to AWS

Click Send and If the request is sent successfully you should get a response with status of 200 OK.

image-10
Request sent Successfully

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.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Kindly subscribe to TechDirectArchive
This is default text for notification bar