I tried to send a Notification using Kaa sandbox with Postman. It's throwing an Unsupported Media Type error.
I tried it with the header "Content-type":
- application/json
- Octed-Steram
But alas! I couldn't solve the issue.
Problem:
Structure of schema:
{
"type": "record",
"name": "Notification",
"namespace": "org.kaa.config",
"fields": [
{
"name": "message",
"type": "string"
}
]
}
Data Parameter:
{"applicationId":"111","schemaId":"139","topicId":"171","type":"USER"}
JSON File:
{
"message" : "Hello world!"
}
Error:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Error 415 Unsupported Media Type</title>
</head>
<body>
<h2>HTTP ERROR 415</h2>
<p>Problem accessing /kaaAdmin/rest/api/sendUnicastNotification. Reason:
<pre> Unsupported Media Type</pre>
</p>
<hr>
<i>
<small>Powered by Jetty://</small>
</i>
<hr/>
</body>
Also, I tried it with the cURL command but I keep getting the same error.
curl -v -S -u devuser:devuser123 -F'notification={"applicationId":"111","schemaId":"139","topicId":"171","type":"USER"};type=application/json' -F file=@notification.json "http://localhost:8080/kaaAdmin/rest/api/sendNotification" | python -mjson.tool