Postman请求API返回错误

环境

  • EMQX 版本:
    5.0.24

  • 操作系统版本:
    linux centos

已经启用了apikey,在Swagger中可以正常调用API,正常发送消息
但是在postman中请求返回
{
“code”: “BAD_REQUEST”,
“message”: “[{"reason":"required_field","path":"root.topic","kind":"validation_error"},{"reason":"required_field","path":"root.payload","kind":"validation_error"}]”
}
请求的JSON是API文档的
{
“payload_encoding”: “plain”,
“topic”: “api/example/topic”,
“qos”: 0,
“clientid”: “string”,
“payload”: “hello emqx api”,
“properties”: {
“payload_format_indicator”: 0,
“message_expiry_interval”: 0,
“response_topic”: “some_other_topic”,
“correlation_data”: “string”,
“user_properties”: {
“foo”: “bar”
},
“content_type”: “text/plain”
},
“retain”: false
}
也进行了Authorization认证,请问通过外部进行API请求,是不是还要做其他的设置

看起来是请求内容不对,只需要这部分

{
"payload_encoding": "plain",
"topic": "api/example/topic",
"qos": 0,
"clientid": "string",
"payload": "hello emqx api",
"properties": {},
"retain": false
}


也是一样的

在Swagger发送就可以



后台报错显示没有权限,但是我看了是没错的