Support Topics Documentation Slack YouTube Blog

Codeless: JSON parse error with custom API block


(Renato N) #1

Hi all,

I have a service previously created with codeless (and works + is “invokable” in backendless console and rest etc), but when I try to use the corresponding codeless block that backendless generates for that function (in this case, in a codeless timer - under the “API Services grouping”), I seem to be getting the following JSON parse error (when I inspect my server logs):

Error: Service invocation failed: ExceptionClass:"JsonMappingException" {Msg:"Unrecognized token 'C1AC9C26': was expecting ('true', 'false' or 'null')

For added context, the only parameter I am passing in to the function is an object’s ID, of which it seems to be breaking on. I also don’t know why it is complaining about it needing to be a boolean value, when the parameter type is specified as a string in backendless console (for that function that is being called).

I also put a print out on the first line of that codeless function that should be called, but it doesn’t even get there, maybe indicating that this parse is even before that?

Is there something wrong when the function is invoked via those blocks?

R


(Vladimir Upirov) #2

Hi Renato

Please provide your APP ID, I’ll investigate your issue

Regards, Vlad


(Renato N) #3

Hi again Vlad!

It’s A324EB2B-1BF5-EB0A-FF36-62F47D198E00

Thanks!
R


(Vladimir Upirov) #4

looks like I’ve found where is the problem

it occurs when you have GET service-method and pass a “String” argument to the service-method. I know how to fix and we will do it and release as soon as possible.
Internal ticket BKNDLSS-15943

while it’s not fixed I can propose you as workaround add “Convert to Text” block between API ServiceMethod and String Argument blocks. see screenshot

http://support.backendless.com/public/attachments/586403bb0daa8fbed5b2143067d99744.png</img>
Sorry for the inconvenience
Regards, Vlad


(Renato N) #5

Not a problem & thanks for the workaround, Vlad - works great! :slight_smile:


(Vladimir Upirov) #6

Hi Renato

Just want to notify you that I’ve fixed it, and we will release the fix asap

Regards, Vlad


(Vladimir Upirov) #7

the fix is released.

and, please remove that workaround (“Convert to Text” block)

Regards, Vlad