Test the API does not accept JSON Request body

  • Question
  • Updated 4 years ago
Using Send 'Hello World' button in Getting started works for my app.

In Test the API, I can't send message to channel. I copy the suggested JSON into the text box, but it keep sending below error message.
Request body is not valid JSON! Make sure your keys are quoted.

I have try below JSON bodies, none of them works.
{ "myMessage": "Hello World" }
{ "mychannel": "Hello World" }
Photo of gosharpliteG

gosharplite

  • 1 Post
  • 0 Reply Likes

Posted 5 years ago

  • 2
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
Sorry for the delayed response!

That sounds really strange, I just tried the examples you posted and they seem to work fine for me.

What browser are you using?
Have you tried using a command line tool such as cURL to send the JSON data? If that works, then perhaps there's something with your browser.
Photo of ovidiu

ovidiu

  • 2 Posts
  • 0 Reply Likes
same problem here, see screen shot: http://screencast.com/t/dHFLxtPCJ
Photo of cgbystrom

cgbystrom, Product Manager

  • 331 Posts
  • 17 Reply Likes
Thanks for reporting and for supplying a screenshot.

I found the bug, it only appeared when Firebug was turned off. It has been corrected now!
Photo of ovidiu

ovidiu

  • 2 Posts
  • 0 Reply Likes
Ok works now but no matter what I enter, the test user always gets the same message about a new comment... but that might be me mucking around :-)

thanks!
Photo of Lee Wei Choong

Lee Wei Choong

  • 5 Posts
  • 0 Reply Likes
Is there any way I can determine the channel from the message parameter?

<script type="text/javascript">
Beacon.connect('b58ae219', ['frontpage', 'chat', 'temp'], {log: true});
Beacon.listen(function (message) { alert(message); });
</script>