android - 如何解决 {"message":"Missing Authentication Token"} 错误?

标签 android amazon-web-services aws-lambda aws-sdk aws-api-gateway

因此,我部署了一个 API(aws api gateway),当我获取调用 url 并填写参数时,出现以下错误:

{"message":"Missing Authentication Token"}

我查看了cloud watch,调用了lambda函数,但是我输入的参数都是空的。我不知道发生了什么。

这是我的调用网址:

https://mupb23gx76.execute-api.us-west-2.amazonaws.com/userAPI/adduser

这是包含所有参数的调用 URL:

https://mupb23gx76.execute-api.us-west-2.amazonaws.com/userAPI/adduser?username=karan&firstName=karan&lastName=chitnis&email=gmail&profileImageURL=whatever&phoneNumber=555&birthdate=0109

这是我的 api 结构的屏幕截图:

enter image description here 这是我为方法请求制作的输入模型。

{
    "$schema":"http://json-schema.org/draft-04/schema#",
    "type":"object",
    "properties":{
        "email":{"type":"string"},
        "birthdate":{"type":"string"},
        "firstName":{"type":"string"},
        "lastName":{"type":"string"},
        "userName":{"type":"string"},
        "phoneNumber":{"type":"string"},
        "profileImageURL":{"type":"string"}
    },
    "title":"InputaddUser"
}

我没有将查询字符串参数放入我的方法请求中,我只是添加了此模型。因为我打算将其部署到 android 上。但我想确保它首先适用于调用 url。

更新

这是我将 URL 放入 Postman 时的云 watch 。 enter image description here

这是我的输入主体:

{
  "email": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="06776175636146616b676f6a2865696b" rel="noreferrer noopener nofollow">[email protected]</a>",
  "birthdate": "1/1/1990",
  "firstName": "Qazar",
  "lastName": "Fbaooqui",
  "username": "Caster",
  "phoneNumber": "some #",
  "profileImageURL":"something"
}

最佳答案

您已将此方法配置为 POST。当我使用正确的动词请求资源时,它似乎有效:

> curl -XPOST https://mupb23gx76.execute-api.us-west-2.amazonaws.com/userAPI/adduser?username=karan&firstName=karan&lastName=chitnis&email=gmail&profileImageURL=whatever&phoneNumber=555&birthdate=0109

{
   "output" : "success"
} 

关于android - 如何解决 {"message":"Missing Authentication Token"} 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41472530/

相关文章:

java - 有没有办法获取设备激活日期(开箱日期)

安卓包管理器 : check if a library APK has been installed

android - 使用百分比怎么样?

amazon-web-services - aws kinesis 迭代器过期后如何刷新?

git - 针对 AWS CodeCommits 运行 git clone 时出现 403 错误

amazon-dynamodb - 发电机数据库 : Scan query does not return all the data

java - 公共(public)摘要值得注意的例子

database-design - 亚马逊发电机数据库模型

javascript - Express GraphQL 必须提供查询字符串。

javascript - 复制和移动脚本