I have a Web application that is build with PHP. The need is to grab data from Aggregate and make them available via the Web Application without [exporting from Aggregate, with briefcase and after import to the database's app].
So I need to quickly grab the data using the briefcase API.
Based on the link provided above and the ODK briefcase code. I understand that I can realise those step:
List the forms with the: /xformsList
Get the definition with the: /formXml?formId=
Get the list of ids of the submitted form: view/submissionList?numEntries=100&cursor=&formId=MEooo
And after download each submission using : view/downloadSubmission
My problem right now is that when I'm trying to get the list of ids of the submitted forms ODK Aggregate redirect me to the logging screen of ODK Aggregate that ask me my credentials
ODK Aggregate redirected me to the Log in page, because my request miss the Authorization header.
OpenRosa is based on the RFC2617 Digest Authentication.
So right now I can list all the instance of a Form with this Url : /view/submissionList
And also download a dedicated answer for a Form with this Url: /view/downloadSubmission
The problem for now is dealing with forms who have version.
I can download instances for forms who don't have version.
But I can't for the other forms
The error that I receive is:
HTTP Status 500 - top level group name: topElement is not as expected:
My formId string is as follow:
my_form_id[@version='3' and @uiVersion=null]/data[@key=uuid:3b475e55-c872-462b-b662-5d95e2d930cd]
Hello all,
I have a problem right now.
It's about dealing with resumptionCursor.
When I send it to the /view/submissionList URL, the server returns an empty idList.
By making a comparaison between aggregate, I saw that the returned resumptionCursor isn't effectivelly the last one.
I'm a bit confused. Both cursors you have attached are equal. Is the second the one the server is returning with an empty id list? If so, everything is looking OK. Can you give more details?
I have send a request with a cursor empty. So the server return me the cursor (That you call the second one)
I send a request again with the value of the cursor( That you call the second one). A this step, the server returns the same cursor I send. With an empty idList.
The fact is that When I check the form on ODK Aggregate, there is more than 100 instances.
So, my requests tell that I gave only 100 instances but on Aggregate there are more than 100.
Hello @ggalmazor,
It's been a while that I did'nt work on this task.
I'm still getting stuck with using the resumptionCursor.
Is there a special encodage to use in order to pass the cursor parameter's value.
While the cursor is blank it returns the first one hundred submissions. That is Ok.
But the form has more than one hundred submissions.
I have tried the following:
Changing the xml's tag in html entities, this returns ids but the ids are the same one returned while passing empty cursor. [I'm using postman to do the test]
Encoding the cursor as uri encode
How can I pass it the Right way?
I was trying to read ServerFetcher.java' s file but can't understand well how the webCursorString is converted.
And passed to the GET request.
Thank you for your help
I made a PHP extractor to JSON.
Maybe you may see where a get stuck
@rpalexis I had this same issue. Solved it by ensuring the _LAST_UPDATE_DATE attribute is converted to UTC and formatted as YYYY-mm-ddTHH:MM:SSZ before sending it in the cursor param.