Skip to content

Commit a3b69b5

Browse files
committed
pinpoint sms apigw updated readme
1 parent d979324 commit a3b69b5

2 files changed

Lines changed: 41 additions & 24 deletions

File tree

_pattern-model/README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# AWS Service 1 to AWS Service 2
1+
# Pinpoint SMS using API Gateway and Lambda
22

33
This pattern shows an example how a phone number can be validated and how a SMS message can be send using Pinpoint APIs which via API Gateway and Lambda deployed using SAM.
44

55
As a pre-requisite, a Pinpoint Application has to be created and its SMS channel should be enabled. Subsequently, this stack can be deployed with pinpoint application id, destination phone number, message that has to be sent, origination number and message type. Please read more about the Pinpoint API calls utilised here:
6-
https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-messages.html#apps-application-id-messagespost
6+
https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-messages.html#apps-application-id-messagespost
77

8-
https://docs.aws.amazon.com/pinpoint/latest/apireference/phone-number-validate.html
8+
https://docs.aws.amazon.com/pinpoint/latest/apireference/phone-number-validate.html
99

1010
Learn more about this pattern at Serverless Land Patterns: << Add the live URL here >>
1111

@@ -26,7 +26,7 @@ Important: this application uses various AWS services and there are costs associ
2626
```
2727
1. Change directory to the pattern directory:
2828
```
29-
cd _patterns-model
29+
cd serverless-patterns/apigw-lambda-pinpoint
3030
```
3131
1. From the command line, use AWS SAM to deploy the AWS resources for the pattern as specified in the template.yml file:
3232
```
@@ -43,11 +43,30 @@ Important: this application uses various AWS services and there are costs associ
4343
4444
## How it works
4545
46-
Explain how the service interaction works.
46+
1. Depending on the country to which SMS messages has to be sent, an [origination number](https://docs.aws.amazon.com/pinpoint/latest/userguide/settings-sms-request-number.html) can be requested accordingly.
47+
48+
2. Next, the SMS message can be sent using the API Gateway deployed via stack.
49+
50+
3. The lambda function's code firstly verify the phone number by using the [phone number validate](https://docs.aws.amazon.com/pinpoint/latest/apireference/phone-number-validate.html) API call.
4751
4852
## Testing
4953
50-
Provide steps to trigger the integration and show what should be observed if successful.
54+
1. You can make a request to API Gateway with the following payload:
55+
56+
```
57+
{
58+
"destination_number": "",
59+
"message": "",
60+
"pinpoint_app_id": "",
61+
"origination_number": "",
62+
"message_type": ""
63+
}
64+
```
65+
2. If the message is sent successfully, then you will receive the following response:
66+
67+
```
68+
Message sent! Message ID: <random message id>
69+
```
5170
5271
## Cleanup
5372

_pattern-model/example-pattern.json

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
11
{
2-
"title": "Step Functions to Athena",
3-
"description": "Create a Step Functions workflow to query Amazon Athena.",
2+
"title": "Pinpoint SMS via API Gateway and Lambda",
3+
"description": "Validate phone number and send SMS from Pinpoint via API Gateway and Lambda",
44
"language": "Python",
55
"level": "200",
6-
"framework": "CDK",
6+
"framework": "SAM",
77
"introBox": {
88
"headline": "How it works",
99
"text": [
10-
"This sample project demonstrates how to use an AWS Step Functions state machine to query Athena and get the results. This pattern is leveraging the native integration between these 2 services which means only JSON-based, structured language is used to define the implementation.",
11-
"With Amazon Athena you can get up to 1000 results per invocation of the GetQueryResults method and this is the reason why the Step Function has a loop to get more results. The results are sent to a Map which can be configured to handle (the DoSomething state) the items in parallel or one by one by modifying the max_concurrency parameter.",
12-
"This pattern deploys one Step Functions, two S3 Buckets, one Glue table and one Glue database."
10+
"This pattern shows an example how a phone number can be validated and how a SMS message can be send using Pinpoint APIs which via API Gateway and Lambda deployed using SAM."
1311
]
1412
},
1513
"gitHub": {
1614
"template": {
17-
"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/sfn-athena-cdk-python",
18-
"templateURL": "serverless-patterns/sfn-athena-cdk-python",
19-
"projectFolder": "sfn-athena-cdk-python",
20-
"templateFile": "sfn_athena_cdk_python/sfn_athena_cdk_python_stack.py"
15+
"repoURL": "https://github.com/aws-samples/serverless-patterns/tree/main/apigw-lambda-pinpoint",
16+
"templateURL": "serverless-patterns/apigw-lambda-pinpoint",
17+
"projectFolder": "apigw-lambda-pinpoint",
18+
"templateFile": "template.py"
2119
}
2220
},
2321
"resources": {
2422
"bullets": [
2523
{
26-
"text": "Call Athena with Step Functions",
27-
"link": "https://docs.aws.amazon.com/step-functions/latest/dg/connect-athena.html"
24+
"text": "Send Messages Pinpoint",
25+
"link": "https://docs.aws.amazon.com/pinpoint/latest/apireference/apps-application-id-messages.html#apps-application-id-messagespost"
2826
},
2927
{
30-
"text": "Amazon Athena - Serverless Interactive Query Service",
31-
"link": "https://aws.amazon.com/athena/"
28+
"text": "Phone number validate",
29+
"link": "https://docs.aws.amazon.com/pinpoint/latest/apireference/phone-number-validate.html"
3230
}
3331
]
3432
},
@@ -44,15 +42,15 @@
4442
},
4543
"cleanup": {
4644
"text": [
47-
"Delete the stack: <code>cdk delete</code>."
45+
"Delete the stack: <code>sam delete --stack-name STACK_NAME</code>."
4846
]
4947
},
5048
"authors": [
5149
{
52-
"name": "Your name",
50+
"name": "Sahil Malhotra",
5351
"image": "link-to-your-photo.jpg",
54-
"bio": "Your bio.",
55-
"linkedin": "linked-in-ID",
52+
"bio": "Serverless enthusiast",
53+
"linkedin": "https://www.linkedin.com/in/smalhotraa/",
5654
"twitter": "twitter-handle"
5755
}
5856
]

0 commit comments

Comments
 (0)