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 .
×
Create a free account

Client API?

Hi there, Is there a client API for players to use? I'd rather like to stop having to hack together scripts with greasemonkey that break every time they update! Thanks
1425735214
Lithl
Pro
Sheet Author
API Scripter
No, there is not. Long-term, there are plans for a RESTful API, but that would not be modifying the client.
Man, that's a real shame.
1425752063
Gen Kitty
Forum Champion
What sorts of greasemonkey scripts have you been using? What functionality have you been adding/removing via these scripts? Maybe there's issues we can fix, if we're aware of the troubles you're having.
1425763194

Edited 1425763263
I've been using it to import stats from chummer5 files through GET requests, then messing around with DOM element creation hooking to find the char sheets and fill it in with this new data. It's very unreliable but works fairly well when it does and broke fairly recently, perhaps because of a slight change to the webpage structure. It would be extremely nice if we could do stuff like intercept the chat before it's sent to run JS macros or directly access variables in the character journals/sheets in some capacity.
1425790441
Gen Kitty
Forum Champion
You can access variables in the character sheet already via @{ATTRIBUTE} or @{CHARACTER|ATTRIBUTE} in a macro (depending on where the macro is stored). Campaigns created by those with a Mentor level subscription can use the API to do extra things, this may cover your 'JS macros' comment.
Not quite as this is for users and I don't believe the mentor api can make http requests anyway.
Anyone can access an attribute on a character using the @{character|attribute} syntax. Even users.
1425814883

Edited 1435313189
Gen Kitty
Forum Champion
I do not understand what you mean by 'This is for users'. Could you elaborate?
As in, non GMs who aren't mentors who currently have to modify sheet variables programmatically by hacking the html apart would find it much easier if there were some standard function calls they could make to change said variables, not access them.
1425850599

Edited 1425850609
vÍnce
Pro
Sheet Author
Ryan H. said: As in, non GMs who aren't mentors who currently have to modify sheet variables programmatically by hacking the html apart would find it much easier if there were some standard function calls they could make to change said variables, not access them. You're starting to make me paranoid of my own player's now Ryan...
Haha- as in your journals you have access to and could change anyway, not anything they couldn't already do.