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

Help With Rolls JSON

1599082611
Nick O.
Forum Champion
If I parse the json coming back from a roll, I see content specified like this: "{\"type\":\"V\",\"rolls\":[{\"type\":\"R\",\"dice\":1,\"sides\":20,\"mods\":{},\"results\":[{\"v\":1}]},{\"type\":\"M\",\"expr\":\"+4\"}],\"resultType\":\"sum\",\"total\":5}" What does type V or R or M mean? 
1599083539
The Aaron
Roll20 Production Team
API Scripter
There's no specific guidance on this that I'm aware of, but you can kind of infer them. V is a Value, seems to be the top level for any given formula. M is a Math operation, which can include a constant, like +3 R is a Roll, where dice were involved, like 3d6 L is a Label, like [Strength] G is a Group, like {3d6, 2d5} Those are all I can think of right now.  There might be a few others, but I don't think so.
1599132808
Nick O.
Forum Champion
Awesome. Thanks, Aaron!