Webhook HTTP header for AWS API

I'm trying to create a webhook task to post a request to the Amazon Cognito user pools API. I'm having trouble figuring out the HTTP header that's required for signing the request. Has anyone else figured out a solution for invoking an AWS API from AppSheet? As always, any guidance is appreciated.

Solved Solved
0 12 1,239
1 ACCEPTED SOLUTION

I got this working with this library you shared.

  1. Your actions should be called as AWSCognitoIdentityProviderService.{action}
  2. You need the header 'Content-Type': 'application/x-amz-json-1.1'

 

function DescribeUserPool() {
  AWS.init('accessKey', 'secretKey')
  let service = 'cognito-idp'
  let action = 'AWSCognitoIdentityProviderService.DescribeUserPool'
  let params = {}
  let region = 'us-east-1'
  let method = 'POST'
  let payload = {'UserPoolId': 'userPoolId'}
  let headers = {'Content-Type': 'application/x-amz-json-1.1'}
  let response = AWS.request(service,action,params,region,method,payload,headers)
  Logger.log(response)
}

 

View solution in original post

12 REPLIES 12