How to get "Application ID" from Amazon Pinpoint through postman - amazon-web-services

I am trying to get application ID for sending a message from AWS Pinpoint through Postman, But I am unable to get the Application ID.
/v1/apps/application-id/messages
This is the application ID That I want. Can you guys help me to get that. I need to implement AWS pinpoint Message to my PHP Project.

If you have an existing Amazon Pinpoint application, you can retrieve the Pinpoint Project-ID or application-ID using the following options :
1) Amazon Pinpoint Console :
or
2) Amazon Pinpoint CLI "get-apps" command as shown below:-
3) Amazon Pinpoint REST API using tools like :
a) Postman: Using this Amazon Pinpoint tutorial for POSTMAN, you can setup Postman and use it to perform Amazon Pinpoint actions including retrieval Pinpoint application ID or project ID by calling the "GetApps" or "GetApp" API.
b) awscurl: A sample illustration of how to use awscurl to retrieve Pinpoint Application ID or project ID is given below :
$ awscurl -H "Content-type: application/json" --service mobiletargeting https://pinpoint.us-east-1.amazonaws.com/v1/apps/

Maybe I can get you started.
Summary: You are referring to the application-id that is the PATH component of the POST URL for sending a direct message from Pinpoint to a recipient, which is discussed here:
https://docs.aws.amazon.com/pinpoint/latest/apireference/rest-api-messages.html
The application-id identifies the app instance that will receive the message from Pinpoint.
Solution: I donĀ“t know the device or execution context of your project.
However, according to the Pinpoint documentation, the Amazon Pinpoint management console or the Amazon Pinpoint REST API enable you to send push notifications to a recipient, regardless of the recipientĀ“s device type or platform (see "Using Amazon Pinpoint to send push notifications" at the following URL: https://aws.amazon.com/pinpoint/push-notification-services/).
Using the Pinpoint REST API, you get the application-id from Pinpoint when you create an app of your project. See the HTTP POST method of the apps resource page here:
https://docs.aws.amazon.com/pinpoint/latest/apireference/rest-api-apps.html
The POST method creates an app, and its ApplicationResponse schema contains the id attribute that is "The unique ID for the application."
Hope this helps.

Related

Amazon API Gateway - Not authorized error as admin user when trying to get all api keys programmatically or using postman

I have been struggling all day, trying to to programmatically create/delete/get apikeys created in the amazon api gateway UI. The weird thing is I am getting a forbidden error even when I got all permissions an account in aws can get.
I am passing everything correctly, the accessKey, secretKey, region and service name from postman to the following url: https://apigateway.eu-west-1.amazonaws.com/apikeys [GET REQUEST] and nothing worked so far.
I've been given admin permissions for the entire aws account and no change. In the aws UI I get do all the actions I'm trying to do from postman/programmatically.

Show AWS API Gateway Cloudwatch Logs in Web Application ( without login to AWS console)

Problem Statement:
As a admin user I want to see who accessed application and what actions did.
Expected Solution :
All the application REST API calls is configured in AWS API Gateway and enabled Cloudwatch logs
AWS cloud watch logs is accessible by login to AWS console and track all the requests.
But I want to see those logs in my application in a data grid showing with some filters
is there a way to get AWS cloud watch logs through API call by passing some conditions ( like user, date, status) ?
If YES - Please help with some samples
Depending on what programming language you are using for your REST API, you would want to include the AWS SDK dependency and use something like FilterLogEvents.

Getting error while invoking API using AWS Lambda. (AWS Lambda + AWS API Gateway+ Postman)

I get an error while invoking the AWS SageMaker endpoint API from a Lambda function. When I call this using Postman, I am getting an error like:
{
"errorMessage": "module initialization error"
}
Just to make it clear, you can't call SageMaker endpoints directly using PostMan (even if it is, it would not be straightforward).
You may need to use AWS SDK (i.e. boto) for that.
Ref : https://aws.amazon.com/blogs/machine-learning/call-an-amazon-sagemaker-model-endpoint-using-amazon-api-gateway-and-aws-lambda/
What I would suggest is to create a small HTTP server with Flask and use the AWS SDK (Boto) to call the endpoint. Then you can call your Flask endpoint using PostMan.
We recommend using AWS SDK to invoke your endpoint. AWS SDK clients handle the serialization for you as well as request signing, etc. It would be really hard to get it right manually with postman.
We have the SDK client available in many languages, including Java, Python, JS, etc.
https://docs.aws.amazon.com/sagemaker/latest/dg/API_runtime_InvokeEndpoint.html#API_runtime_InvokeEndpoint_SeeAlso
Next time please include more details in your question. eg. POST request data, Headers etc.
Anyways, to help you out in calling Sagemaker endpoint using Postman -
In 'Authorization' tab, select type as 'AWS Signature'.
Enter your Access and Secret key of the IAM user which has permission to Sagemaker resources.
Enter the AWS region. eg.us-east-1
Enter 'Service Name' as 'sagemaker'
Select the right content type. Some ML algorithms only accept 'text/csv'.
Select request type as 'POST'
Enter the Sagemaker Invocation url. eg:'https://runtime.sagemaker.us-east-1.amazonaws.com/endpoints/xgboost-xxxx-xx-xx-xx-xx-xx-xxx/invocations'
Try it out and let me know if you have any issues.
Here is how your Postman should look -

Creating Segments in Amazon Pinpoint

I am new to Amazon Pinpoint. I have created a sample webapp using AWS Amplify which generates an event when a button is pressed and sends anaytics to Amazon pinpoint.
Now, I am trying to create Segment for sending email to specific endpoint. But when i am trying to create a segment it shows the following:
I am new to pinpoint. How can i create a segment and send email when specific event occurs?
For creating segments, follow the documentation here: https://docs.aws.amazon.com/pinpoint/latest/userguide/segments-importing.html
When importing a segment, using the CLI or console, type of endpoint and the endpoint address can be specified. If you are trying to send to emails, then channel type should be email and address should be an email address. After importing this segment you will be able to create a campaign with said segment.
For event based triggers, a dynamic segment is needed. This documentation should help in understanding how that works: https://docs.aws.amazon.com/pinpoint/latest/userguide/segments-building.html#segments-building-procedure
Using Amplify SDK to create the endpoints, Amplify by default registers endpoints that have OptOut set to all. Need to set OptOut to NONE for any registered endpoint to show up in "Eligible Endpoints" when creating a segment in the console.

Cannot create AWS-SNS GCM account, showing invalid credentials message

I have looked for resources on this particular problem with little luck so far so I thought I would try here.
I am attempting to create an Amazon Web Service Simple Notification Service app in the AWS-SNS console using GCM. I have created the APNS app for the iOS version with no troubles, however, when attempting to create the GCM version I receive the error: "The credentials you entered are invalid. Please enter valid credentials and try again."
In the Google APIs - API Access dashboard I have created both a key for server app and a key for android app. Below are a few screenshots to illustrate the problem.
Any suggestions as to what the problem may be or any instructional documentation recommendations would be tremendously appreciated.
More on what Rohan has said, it would be on Google's end rather than Amazon's.
Delete the Server API Key in the Google API Console, and create a new one, allowing all IP addresses. Add the new key in AWS SNS, and you should be good to go!
Amazon documentation is very old and not accurate anymore.
When you created your Application and the Credentials on Google Developers Console, from the left menu on Google developer console select:
APIs & auth -> APIs -> Google Cloud Messaging for Android -> Enable API
Google recently migrated a lot of the GCM service/credential handling to Firebase. As a result you need to create a Server Key in the Firebase Console now.
See: Amazon SNS: "Platform credentials are invalid" when re-entering a GCM API key that previously worked
You need to use the API key listed under Key for server apps (with IP locking) in the Google Console. The key listed under Android app will not work.
The Amazon SNS Getting Started with GCM documentation provides step-by-step guidance on setting up your app. If you are still having issues, please contact us via AWS Support or the Amazon SNS forum and we can troubleshoot further.
full disclosure: I am an Amazon SNS engineer.