CommCare HQ offers a way to see the exact data that is being sent to the phones in the form of the "restore" XML. This can often be useful for troubleshooting issues or when doing advanced app building off of lookup tables and other data structures.
Viewing the data
To view the OTA Restore data open www.commcarehq.org/a/[domain]/phone/restore and then enter [username]@[domain].commcarehq.org and the user's commcare password.
Understanding the data format
The data that you will look exactly the same as a normal user registration response, but with a list of case blocks following the registration data (see https://bitbucket.org/javarosa/javarosa/wiki/UserRegistrationAPI). Here is an example:
To understand the casexml spec, see https://bitbucket.org/javarosa/javarosa/wiki/casexml; to understand the fixtures spec, see https://bitbucket.org/commcare/commcare/wiki/fixtures.
When the phone receives the case blocks, for example, it applies them all in order to its internal database, thus reconstructing the case list.
Making the Request Programmatically
Assuming your domain is called "DEMO_DOMAIN", the request must be sent to https://www.commcarehq.org/a/DEMO_DOMAIN/phone/restore/ using HTTP basic auth to supply the username and password of the CHW. In curl, the request would look something like this:
In this example, we are on domain "DEMO_DOMAIN", our CHW's username is "jason", and his password is 1988. You'll note that the username, instead of being just "jason" is the much longer "firstname.lastname@example.org". This is to distinguish him from any other "jason"s on any other domain. The format for the full-length username is: