Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
The developers are currently investigating an issue with logging in + accessing the VTT.
Create a free account

"Unexpected Token ?" APIs interfering with each other?

I have been running 2 APIs in my games for a while.  (Critical & Fumbler) and both have been working correctly.  Recently, I found an API online where I could copy/paste an image url into a prompt and it would automatically convert it to a .png and post it in the chat.  It's a simple script and it works fine on its own.  The problem is it gives me a syntax error in the API Output Console of  SyntaxError: Unexpected token ? when I run it. (It functions fine in the game though).  The big issue is that whenever it is enabled, it seems to prevent the Critical and Fumbler APIs from running.  I'm assuming it gives the Syntax error and stops the API from running any other commands?  I'm not sure to be honest.  Does anyone see a simple way to fix this? The code for the image API is: [Image](?{URL}#.png); I'm assuming the ? is what is throwing the syntax error, but I think I need that to get the prompt to paste the url into.  Any ideas?
1586891334
The Aaron
Roll20 Production Team
API Scripter
The ? in the above is part of the Roll Query ?{URL} which is replaced with the URL you type in the prompt. Can you post the new script or a link to it?  when you see "SyntaxError: Unexpected token ?" it usually means there is something wrong in the source code.
1586892117
Dumbhuman
Pro
Marketplace Creator
That's not really a script you need to install.  It can just be run by entering it into chat and hitting enter.  I'd remove it from the API scripts and just make yourself a macro with that command in it.
... I feel like an idiot.  Hahaha. Thanks KC.  That was the simple fix I was looking for!
1586892672
The Aaron
Roll20 Production Team
API Scripter
Totally fine, it can be a bit confusing when you first start seeing macros and API scripts.  Things like that can be pretty inscrutable. 
1586893378
Dumbhuman
Pro
Marketplace Creator
A lot of understanding comes from trial and error... a lot of error.  It's a perfectly natural way to learn.