Postman Error Unsupported Media Type for send notification

0 votes

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":

  1. application/json
  2. 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

Apr 29, 2019 in IoT (Internet of Things) by Shubham
• 13,490 points
17,991 views

1 answer to this question.

0 votes

Postman Check this link out.

or maybe schemas any field is optional in your notification body. you need change your json file. for example:

{"notifId" : "16243", "notifInfo": {"string":"this is info"}, "notifType" : 90, "notifPayload" : "this is payload" }

answered Apr 29, 2019 by Upasana
• 8,620 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

MQTT protocol connection error

Ok so you need two libraries to ...READ MORE

answered Jul 6, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points

reshown Jul 6, 2018 by Vardhan 3,067 views
0 votes
1 answer

Send LoRa measures to Fiware IOT agent via MQTT

down vote I dont know if I understood ...READ MORE

answered Jul 13, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
1,742 views
0 votes
1 answer

What is the maximum message length for a MQTT broker?

It's not entirely clear what you're asking ...READ MORE

answered Jul 17, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
9,463 views
0 votes
1 answer

Postman : Generating an output as a random number

Try generating your random value in the ...READ MORE

answered Feb 12, 2019 in IoT (Internet of Things) by Upasana
• 8,620 points
6,137 views
0 votes
1 answer

Displaying Table Schema using Power BI with Azure IoT Hub

Answering your first question, Event Hubs are ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,310 views
0 votes
1 answer

How to use the data I receive from Azure IoT Hub?

The payload you receive will be a ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by DataKing99
• 8,250 points
1,808 views
0 votes
1 answer

Failure of JSON parsing in Arduino and ESP8266

I'm assuming it's because of the garbage ...READ MORE

answered Dec 24, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
2,816 views
0 votes
1 answer

What is the time taken by a 200 byte message for transmission in a beacon-enabled network?

Now, data rates of IEEE 802.15.4 are ...READ MORE

answered Aug 24, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
888 views
0 votes
1 answer

When to use MQTT and when to use REST for event submission?

MQTT is designed to be a fast ...READ MORE

answered Sep 14, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,510 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP