There is a relatively new facility for returning a JSON object in the automatic exercise checking on the reference page you have posted but I don't see something that would accept JSON objects. On the other hand there are commands for passing in xml strings and returning them that have been part of geogebra for some time and might be suitable. How useful they are may depend what kind of objects you are trying to construct.
This sounds like a great project -- please keep us informed as to how things work out.
-- Mike