Ishan Garg
Ishan Garg

Reputation: 11

How to send sms in pinpoint aws

API Url requested-https://pinpoint.us-east-1.amazonaws.com/v1/apps/c29387d21e1744d682f6f7a0803327c8/messages

Request body  
    {
    "Context": {},
    "MessageConfiguration": {
    "SMSMessage": {
    "Body": "string",
    "Substitutions": {},
    "SenderId": "string",
    "MessageType": "TRANSACTIONAL"
    }
    },
    "Addresses": {},
    "Endpoints":{"destinations":"+91xxxxxxxxxxx"}
    }

We have to send SMS using AWS Pinpoint service so anyone who has worked on its REST APIs.

Upvotes: 1

Views: 3797

Answers (1)

Zhongce Xie
Zhongce Xie

Reputation: 19

Calling Pinpoint REST API using AWSCLI details: https://aws.amazon.com/cli/

Documentation with example request are provided here: https://docs.aws.amazon.com/pinpoint/latest/apireference/welcome.html

Here is the step by step instruction:

  1. Go to IAM Management Console and find the user associated with the account you want to use.
  2. Find AccessKey and SecretKey associated with that IAM User
  3. Configure your AWSCLI using the credentials found in step 2

Here is a cli example:

aws --region=$REGION_ARG pinpoint send-messages --application-id $APP_ID --message-request "{ \"Addresses\": { \"$PHONE_NUMBER\": { \"ChannelType\": \"SMS\" } }, \"MessageConfiguration\": { \"SMSMessage\": { \"Body\": \"MSS Test\", \"MessageType\": \"TRANSACTIONAL\" } } }"

Upvotes: 2

Related Questions