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
- Do we retry if the voice event webhook fails?
- How do I verify that the Voice API Webhook request and it's payload has not been tampered during transit?
- How To Check Call Quality With Voice Inspector
- What is a Conversation ID?
- How to configure the custom webhook timeout for Voice API functionality and what are the allowed timeout ranges ?
- How do I change TTL for the Conversations and Call Legs?
- Why are call progress events not being received on the Event URL defined in the conversation action NCCO?
- Why is there an extended silence at the beginning of a call and how can it be reduced?
- Intermittent WebSocket Disconnections
- What Is An NCCO