onesignal API,邮递员:找不到 app_id

问题描述

在尝试按照 onesignal 文档使用邮递员向 onesignal 发送 POST 请求以发送通知时,尝试发送时出现以下错误"app_id not found. You may be missing a Content-Type: application/json header."

我确实有正确的内容类型标题

Image of my request headers with the API key removed for obvious reasons

此外,我相信我的 JSON 在语法上是正确的:

{
    "included_segments": [
        "Subscribed Users"
    ],"App_id": "{Removed for obvIoUs reasons}","contents": {
        "en": "This is a message,sent from postman using the onesignal API"
    },"headings": {
        "en": "This is a heading"
    },"subtitle": {
        "en": "This is a subtitle,it should only appear on iOS devices"
    },"ios_badgeType": "SetTo","ios_badgeCount": 1,"priority": 10
}

不知道从这里去哪里。

此处的文档:https://documentation.onesignal.com/docs/using-postman

非常感谢任何和所有帮助!

谢谢!

解决方法

我解决了这个问题,并将在未来为人们添加我的解决方案。 在我的消息的 json 正文中,我有“App_id”,它想要“app_id”。更改 a 的大小写使其起作用。