How to use AWS amplify API in postman? - amazon-web-services

I have to use below inbuild functions of APIs but how can I use that function to create dynamic sub domain?
It meant, what will be host name for that? and how can I pass request object?
POST /apps/appId/domains HTTP/1.1
what will be the Request URI for that?
https://docs.aws.amazon.com/amplify/latest/APIReference/API_CreateDomainAssociation.html
If anyone have knowledge about it and then please help me.
Thanks in advance

Related

How to use cognito:username at http proxy integration of HttpApi of AWS?

I want to use the variable named event.requestContext.authorizer.jwt.claims.cognito:username which is the result of JWT authorizer at the URI of http proxy integration of HttpApi(I mean not RestApi) of AWS , because I want to access the information of authorized user. The exposed api is like this.
https://xxxxxx.com/platform/pro/user/john
pro means production .
john is event.requestContext.authorizer.jwt.claims.cognito:username .
The management console said my input like this is error.
https://xxxxxx.com/platform/${stageVariables.stage}/user/${event.requestContext.authorizer.jwt.claims.cognito:username}
I think : is NG.
Please help me.
I just found this question by accident. I guess you solved this in the meantime, but in case it's still relevant, you need to put cognito:username in quotes and brackets, so instead of ${event.requestContext.authorizer.jwt.claims.cognito:username} use ${event.requestContext.authorizer.jwt.claims['cognito:username']}.

Optional Path parameters in AWS APIGateway

I am started to work on APIGateway for writing rest API using SAM template.
I have a endpoint as "example.com", here I need to have path param as optional parameter;
ex: www.example.com/user/{optional_Parameter}/
When I tried to hit the above URL without giving parameter it shows 403 Forbidden Error.
Referred few docs, however no luck. If anyone achieved in API Gateway please do share the workaround to achieve having Optional path parameter.
Thanks in advance
The easiest way to achieve it is to define both www.example.com/user/ and www.example.com/user/{optional_Parameter}/ as endpoints in your API gateway.

Capture a header in AWS API Gateway integration request to use in Path Override

in AWS API Gateway, we want to capture the X-Amzn-Trace-Id header in the integration request and use it in path override so that it can be used as the object name for the new object created. I tried this(attached) based on my previous experience and the docs, but it didn't work:
Anyone know how to do it, or has any ideas? Please let me know. Thanks in advance.

How to pass a parameter to a wsdl URL?

I know it is not the current ways of doing things but...
How do I pass a http parameter to a WSDL URL?
I tried to attach it to the end of the query String like
"http://host:port/serviceA/methodA?wsdl&parameterName=value"
but the webservice refuse to read it.
What is the correct way of doing it?
I am no authority, but I am working with a web service (SOAP) at the moment - SOAP services seem to expect an XML Document, delivered as a POST.
Try doing a HTTP POST instead of a GET:
curl -d parameterName=value "http://host:port/serviceA/methodA?wsdl"
I solved this question by changing the endpoint URL. (not the WSDL URL)
Thanks for you reponses.

Web services post request playframework 2.0.4

I'm trying to do a simple POST request to a google API from Play 2.0.4 using HTTPS
but I don't know how to post parameters.
I am using Java.
WS.url("https://myurl"). ... .post("application/x-www-form-urlencoded");
I think .setQueryParemeter is only for GET request.
Any help is welcome.
Regards
After looking around I found it.
WS.url("URL").post("param1=val1&param2=val2...");