The community forums are in BETA and closed to the public.

Error:127-0 Bad request.Please contact support with error details. :[0,"Invalid JSON","...."]

This error keeps on coming .How to prevent this error and Why is this error coming?

Abdul, please send the details of your issue to support@pubnub.com (if you haven't already). Please provide:

  • sub-key
  • PubNub SDKs/versions you are using and which one is getting this error
  • the message that was publish that is causing this Invalid JSON error

But likely cause could be:

  • The JSON you are trying to publish is invalid. Test the message payload with JSONLint.com
  • You are trying to serialize or stringify your JSON before you publish - just publish as a JSON object and the PubNub SDKs will take care of the rest

I am receiving the same error with PubNub on android version Error Message: Bad request. Please contact support with error details. : [0,"Invalid JSON","14247853259709794"] SDK: 3.7.2 (Pubnub-Android-3.7.2.jar) Message: {"name":"asd"}

While it is working for simple string Message: UPDATEKIDFEED

Vivek, are you sending the JSON as a string or as a JSON object. If as a string, then stop doing that and send as an object instead. You can send strings but it can't be JSON content or it gets escaped. If you are still having issues please send the full requested details to support.

Thanks Craig passing data as JSON fixed it.

Beautiful!


Comments to this discussion are now closed!