從服務端應用向雲Message QueueTT 版發送單條訊息。
介面說明
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
mq:SendMessage |
none |
*全部資源
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| MqttTopic |
string |
是 |
雲Message QueueTT 版的 Topic,即訊息發送的目標 Topic。 |
TopicA |
| InstanceId |
string |
是 |
雲Message QueueTT 版執行個體的 ID,一定要和用戶端實際使用的執行個體 ID 匹配。您可以在控制台執行個體詳情頁面的基礎資訊地區查看。 |
post-cn-0pp12gl**** |
| Payload |
string |
是 |
訊息內容,即訊息負載。建議自行做 Base 64 編碼,避免傳輸不可見字元。 |
test |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| MsgId |
string |
訊息的唯一標識,訊息發送成功後服務端會返回訊息 ID。 |
0B736D997B7F45FF54E61C1C1B58**** |
| RequestId |
string |
公用參數,每個請求的 ID 都是唯一的。 |
020F6A43-19E6-4B6E-B846-44EB31DF**** |
樣本
正常返回樣本
JSON格式
{
"MsgId": "0B736D997B7F45FF54E61C1C1B58****",
"RequestId": "020F6A43-19E6-4B6E-B846-44EB31DF****"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | CheckAccountInfoFailed | An error occurred while checking the account information by the STS token. | 解析STS Token帳號資訊失敗。 |
| 400 | InstancePermissionCheckFailed | An error occurred while validating the permissions of the instance. Please verify the account that created the instance and its permissions settings. | 執行個體許可權校正失敗,請確認MQTT執行個體的所屬關係以及授權策略。 |
| 400 | ParameterCheckFailed | An error occurred while validating the parameters. The parameters may be missing or invalid. | 參數校正失敗,可能缺失或者傳入值非法。 |
| 400 | PermissionCheckFailed | An error occurred while validating the resource permissions. Please check the account that created the instance, topic, and GroupId, and check their permission settings. | 資源許可權校正失敗,請檢查執行個體、Topic和Group ID的所屬許可權和授權策略。 |
| 400 | InvalidParameter.%s | An error occurred while validating the parameter. The parameter may be missing or invalid. | 參數校正失敗,可能缺失或者傳入值非法。 |
| 500 | InternalError | An error occurred while processing your request. Try again later. | MQTT後端服務異常,請重試。 |
| 500 | SendMessageFailed | A storage exception occurred while sending the message. Please try again. | 由於後端儲存異常,訊息發送失敗,請重試。 |
| 500 | SystemOverFlow | An error occurred while processing your request. Please try again. | 系統限流,請重試。 |
| 404 | ApiNotSupport | The specified API is not supported. | 當前介面不支援,請檢查。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。