Multiexcerpt include macro | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
When a payload is created a repeat record is registered. A repeat record represents a place in the repeat record queue, and points to the payload. On registration, its status is set to "pending" , and HQ tries to send the payload immediately. If sending succeeds, its status is changed to "succeeded" and the process is complete.
If sending fails, its status is changed to "failed" , and it will be retried in about an hour. It is retried up to five times. There are multiple retries, and each time the interval is multiplied by 3--so 3 hours, 9 hours, etc. This increases the chance between tries is increased. This improves the chances of a successful send, because it creates a maximum delay of a few days which allows a remote destination to be unavailable for a whole weekend but still receive the payload on Monday.If after five attempts sending still gives the endpoint more time to recover.
After a number of attempts (depending on the error) if the send has not succeeded, the repeat record's state is changed to "cancelled.".
What to have your server expect
...
Code Block | ||
---|---|---|
| ||
<case case_id="b0916685-7247-4c44-b712-633d3d64e0c0" date_modified="2015-04-17T16:04:54.950000Z" user_id="d0e472a6b36dfd3ee5059222e12b8c1b" xmlns="http://commcarehq.org/case/transaction/v2"> <create> <case_type>mscase</case_type> <case_name>Trees</case_name> <owner_id>d0e472a6b36dfd3ee5059222e12b8c1b</owner_id> </create> </case> |
RAW BODY (JSON)
Code Block | ||
---|---|---|
| ||
{ "case_id" : "b0916685-7247-4c44-b712-633d3d64e0c0", "closed" : false, "date_closed" : null, "date_modified" : "2015-04-17T16:04:54.950000Z", "domain" : "demo", "indices" : { }, "properties" : { "case_name" : "Trees", "case_type" : "mscase", "date_opened" : "2012-03-13T18:21:52Z", "owner_id" : "d0e472a6b36dfd3ee5059222e12b8c1b", }, "server_date_modified" : "2012-04-05T23:56:41Z", "server_date_opened" : "2012-04-05T23:56:41Z", "user_id" : "d0e472a6b36dfd3ee5059222e12b8c1b", "version" : "2.0", "xform_ids" : [ "3HQEXR2S0GIRFY2GF40HAR7ZE" ] } |
...