Skip to content

Unexpected token B in JSON at position 14 #12

Closed Answered by jreyesr
JV300381 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @JV300381!

I think that the first issue, the Unexpected token B, is because the JSON that is being provided to the Context field isn't actually valid JSON. The values that are strings (namely, BASIC SALARY and EARNINGS) should be wrapped in double quotes:

{"reportname":"BASIC SALARY","reportvalue":35000,"reporttype":"EARNINGS"}

Double quotes are missing here:

The JSON that is being passed now, that is, {"reportname":BASIC SALARY,"reportvalue":35000, "reporttype":EARNINGS}, doesn't comply with the JSON syntax. After {"reportname":, there should come either:

  • A string (e.g. {"reportname":"A STRING", ...}), which is what you want, and strings always start with a double quote ", not B
  • A…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JV300381
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #11 on September 19, 2024 13:57.