Hi James,
If you have a dummy dimension whose member covers every entry, then you will get the total by specifying that member.
For example, you have a location dimension whose only member is "earth", then you get the total when you specify {"location": "earth"}.
Hope my blog can give you some idea.
A study of getData / getDataAsString method
Best regards,
Alfred