Question
Why do I see "SyntaxError: Unexpected token p in JSON at position 1" when creating JWT with the Vonage CLI?
Applies To
- JWT
- Vonage CLI version 1.2.4
Answer
Following instructions in Developer Docs and when using Vonage CLI version 1.2.4 on Windows-based PCs, you may need to escape the JSON text fed to this command. For example:
vonage jwt --key_file=./my_sample_app.key --acl='{\"paths\":{\"\/*\/users\/**\":{},\"\/*\/conversations\/**\":{},\"\/*\/sessions\/**\":{},\"\/*\/devices\/**\":{},\"\/*\/image\/**\":{},\"\/*\/media\/**\":{},\"\/*\/applications\/**\":{},\"\/*\/push\/**\":{},\"\/*\/knocking\/**\":{},\"\/*\/legs\/**\":{}}}' --subject=Alice --app_id=MY_APP_ID
Additional Information
This does not appear to happen on macOS systems.
Articles in this section
- Why are call progress events not being received on the Event URL defined in the conversation action NCCO?
- What types of DTMF are supported?
- Why do I see "SyntaxError: Unexpected token p in JSON at position 1" when creating JWT with the Vonage CLI?
- Why does Caller ID show as potential spam?
- Is SIP Diversion header supported?
- Can I display my name on the receiving party's phone for outbound calls?
- How long are call legs stored?
- Can I send fax over the Vonage Voice API?
- Which IP addresseses should I allow in order to receive voice traffic from the Vonage API Platform?
- Is WebRTC supported with Vonage Voice API?