Form Submit API

Hi,

I’ve trouble with form submission. I don’t know what are variables in the
xml is required. Can you show me an example of XML that used to upload
to https://www.commcarehq.org/a/demo/receiver/submission/

Thank you very much for your help.
Best,

Hello,

CommCare will accept any XForms-compliant submission, although you will
need to follow the metadata API
https://bitbucket.org/javarosa/javarosa/wiki/OpenRosaMetaDataSchema
and casexml
structure https://github.com/dimagi/commcare/wiki/casexml20 if you want
to modify cases and have reports pick up the forms correctly.

The simplest thing to do is to make an application that contains the
form/case structure you want and then look at the XML submitted from that
application from the submit history report.

What are you using the APIs for?

thanks,
Cory

··· On Tue, Oct 6, 2015 at 3:03 PM, Ratchapong Kanaprach wrote:

Hi,

I’ve trouble with form submission. I don’t know what are variables in the
xml is required. Can you show me an example of XML that used to upload to
https://www.commcarehq.org/a/demo/receiver/submission/

Thank you very much for your help.
Best,


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hi,

Firstly, thank you very much for the reply. That’s superb very quick
response.

We currently using CommCare on mobile while the staff is outside the office
and desktop computer for the follow up. All of the data for the follow up
already exist in the in desktop computer. For the convenient of the staff
using desktop computer, we decide to push data from computer with on button
instead of using mobile and input all the data again. Hopefully, this will
reduce human error and faster service.

Currently, I’m working with 2 people from different position. We’re trying
to submit form with PHP program. The one whose familiar with Commcare is
not programmer and didn’t know what the programmer need for using API and
he try to explain me how the program work which I already know but the API.
While the programmer never heard about CommCare before and they need more
details about the API where the first guy can’t provide that. I’m in the
very awkward position right now. I decided to come here seek for the clear
information.

Here… what I’ve done so far.

I can pull the case in JSON format and can explain it to the programmer.
This is no problem at all. They got what they need. Also I’m not sure
whether it is a bug or not but when I try to use format=xml it keep shows
an error telling that CommCare’s server is under maintenance which is
weird. I also attempt to used filter with some properties, like case-name
which work pretty well but self create properties is not working. Is this
normal ?
(https://www.commcarehq.org/a/{App Name}/api/v0.4/case/)

I’ve read the Submission API but I see only the XML submission which XML is
required for submitting form. But there are no example about XML. I try to
push some data and it reply nothing and it not shows in the program too.
(https://confluence.dimagi.com/display/commcarepublic/Submission+API).
Compare to the Case API which very well explain but the submission page is
quite vague for me. I don’t know where to get the form ID and require
variable name. ** According to your explanation, the form submission export
same as the form submission we’re going to post to the server. This is a
bit problem for me. I can’t get format=xml work with the API.

I can access the CommCare HQ Tools Page. I understand how it works almost
of it. I see the parameter of each case, the filter and prerequisite. I do
know that when I added “Child Cases” into the form I have to Submit that
form separately with the API. So I have to push form to the commcare 2
times instead of one. ** In the form I’ve update “parent/data-xxxx” this
mean I’ve to push another API to update the cases too?
(https://www.commcarehq.org/a/demo/receiver/)

That is what i’m working on.

Thank you very much for your help.
Best,

··· On Tuesday, October 6, 2015 at 4:41:10 PM UTC+7, Cory Zue wrote: > > Hello, > > CommCare will accept any XForms-compliant submission, although you will > need to follow the metadata API > and casexml > structure if you want > to modify cases and have reports pick up the forms correctly. > > The simplest thing to do is to make an application that contains the > form/case structure you want and then look at the XML submitted from that > application from the submit history report. > > What are you using the APIs for? > > thanks, > Cory > > On Tue, Oct 6, 2015 at 3:03 PM, Ratchapong Kanaprach <ratch...@gmail.com > wrote: > >> Hi, >> >> I've trouble with form submission. I don't know what are variables in the >> xml is required. Can you show me an example of XML that used to upload to >> https://www.commcarehq.org/a/demo/receiver/submission/ >> >> Thank you very much for your help. >> Best, >> >> -- >> You received this message because you are subscribed to the Google Groups >> "commcare-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to commcare-user...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > >

Hello,

If you are already using commcare the best way to get example XML is to go
to the submit history report, click on a form you want to mimic, and then
the XML tab. This is the exact XML that you would submit for that form.

Hi,

Firstly, thank you very much for the reply. That’s superb very quick
response.

We currently using CommCare on mobile while the staff is outside the
office and desktop computer for the follow up. All of the data for the
follow up already exist in the in desktop computer. For the convenient of
the staff using desktop computer, we decide to push data from computer with
on button instead of using mobile and input all the data again. Hopefully,
this will reduce human error and faster service.

Currently, I’m working with 2 people from different position. We’re trying
to submit form with PHP program. The one whose familiar with Commcare is
not programmer and didn’t know what the programmer need for using API and
he try to explain me how the program work which I already know but the API.
While the programmer never heard about CommCare before and they need more
details about the API where the first guy can’t provide that. I’m in the
very awkward position right now. I decided to come here seek for the clear
information.

Here… what I’ve done so far.

I can pull the case in JSON format and can explain it to the programmer.
This is no problem at all. They got what they need. Also I’m not sure
whether it is a bug or not but when I try to use format=xml it keep shows
an error telling that CommCare’s server is under maintenance which is
weird. I also attempt to used filter with some properties, like case-name
which work pretty well but self create properties is not working. Is this
normal ?
(https://www.commcarehq.org/a/{App Name}/api/v0.4/case/)

Could you report an issue for this with clear reproduction steps? It may be
a bug or it may be unsupported - I’m not sure offhand.

··· > > I've read the Submission API but I see only the XML submission which XML > is required for submitting form. But there are no example about XML. I try > to push some data and it reply nothing and it not shows in the program too. > (https://confluence.dimagi.com/display/commcarepublic/Submission+API). > Compare to the Case API which very well explain but the submission page is > quite vague for me. I don't know where to get the form ID and require > variable name. ** According to your explanation, the form submission > export same as the form submission we're going to post to the server. This > is a bit problem for me. I can't get format=xml work with the API. > > > I can access the CommCare HQ Tools Page. I understand how it works almost > of it. I see the parameter of each case, the filter and prerequisite. I do > know that when I added "Child Cases" into the form I have to Submit that > form separately with the API. So I have to push form to the commcare 2 > times instead of one. ** In the form I've update "parent/data-xxxx" this > mean I've to push another API to update the cases too? ( > https://www.commcarehq.org/a/demo/receiver/) > > That is what i'm working on. > > Thank you very much for your help. > Best, > > > > On Tuesday, October 6, 2015 at 4:41:10 PM UTC+7, Cory Zue wrote: >> >> Hello, >> >> CommCare will accept any XForms-compliant submission, although you will >> need to follow the metadata API >> >> and casexml structure >> if you want to modify cases and have reports pick up the forms correctly. >> >> The simplest thing to do is to make an application that contains the >> form/case structure you want and then look at the XML submitted from that >> application from the submit history report. >> >> What are you using the APIs for? >> >> thanks, >> Cory >> >> On Tue, Oct 6, 2015 at 3:03 PM, Ratchapong Kanaprach wrote: >> >>> Hi, >>> >>> I've trouble with form submission. I don't know what are variables in >>> the xml is required. Can you show me an example of XML that used to upload >>> to https://www.commcarehq.org/a/demo/receiver/submission/ >>> >>> Thank you very much for your help. >>> Best, >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "commcare-users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to commcare-user...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- > You received this message because you are subscribed to the Google Groups > "commcare-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to commcare-users+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >

Hi,

Thank you very much for the reply and sorry for late reply. I’m busy with
other things.

About the error, it looks like the CommCareHQ for XML is maintenance at
that time. So, format=xml is working now. About the XML, I’ve download it
and got everthing inside it. Thank you very much. The image which I’ve
attached here is the error I saw on that day.

Best,

R.K.

https://lh3.googleusercontent.com/-LPNPIITgPLo/Vh39uXMM0vI/AAAAAAAAAHY/MUUR2gegtiU/s1600/2015-10-05_Error.jpg

··· On Wednesday, October 7, 2015 at 1:29:14 PM UTC+7, Cory Zue wrote: > > Hello, > > If you are already using commcare the best way to get example XML is to go > to the submit history report, click on a form you want to mimic, and then > the XML tab. This is the exact XML that you would submit for that form. > > Hi, >> >> Firstly, thank you very much for the reply. That's superb very quick >> response. >> >> We currently using CommCare on mobile while the staff is outside the >> office and desktop computer for the follow up. All of the data for the >> follow up already exist in the in desktop computer. For the convenient of >> the staff using desktop computer, we decide to push data from computer with >> on button instead of using mobile and input all the data again. Hopefully, >> this will reduce human error and faster service. >> >> Currently, I'm working with 2 people from different position. We're >> trying to submit form with PHP program. The one whose familiar with >> Commcare is not programmer and didn't know what the programmer need for >> using API and he try to explain me how the program work which I already >> know but the API. While the programmer never heard about CommCare before >> and they need more details about the API where the first guy can't provide >> that. I'm in the very awkward position right now. I decided to come here >> seek for the clear information. >> >> Here.. what I've done so far. >> >> I can pull the case in JSON format and can explain it to the programmer. >> This is no problem at all. They got what they need. Also I'm not sure >> whether it is a bug or not but when I try to use format=xml it keep shows >> an error telling that CommCare's server is under maintenance which is >> weird. I also attempt to used filter with some properties, like case-name >> which work pretty well but self create properties is not working. Is this >> normal ? >> (https://www.commcarehq.org/a/{App Name}/api/v0.4/case/) >> > > Could you report an issue for this with clear reproduction steps? It may > be a bug or it may be unsupported - I'm not sure offhand. > > >> >> I've read the Submission API but I see only the XML submission which XML >> is required for submitting form. But there are no example about XML. I try >> to push some data and it reply nothing and it not shows in the program too. >> (https://confluence.dimagi.com/display/commcarepublic/Submission+API). >> Compare to the Case API which very well explain but the submission page is >> quite vague for me. I don't know where to get the form ID and require >> variable name. ** According to your explanation, the form submission >> export same as the form submission we're going to post to the server. This >> is a bit problem for me. I can't get format=xml work with the API. >> >> >> I can access the CommCare HQ Tools Page. I understand how it works almost >> of it. I see the parameter of each case, the filter and prerequisite. I do >> know that when I added "Child Cases" into the form I have to Submit that >> form separately with the API. So I have to push form to the commcare 2 >> times instead of one. ** In the form I've update "parent/data-xxxx" this >> mean I've to push another API to update the cases too? ( >> https://www.commcarehq.org/a/demo/receiver/) >> >> That is what i'm working on. >> >> Thank you very much for your help. >> Best, >> >> >> >> On Tuesday, October 6, 2015 at 4:41:10 PM UTC+7, Cory Zue wrote: >>> >>> Hello, >>> >>> CommCare will accept any XForms-compliant submission, although you will >>> need to follow the metadata API >>> >>> and casexml structure >>> if you want to >>> modify cases and have reports pick up the forms correctly. >>> >>> The simplest thing to do is to make an application that contains the >>> form/case structure you want and then look at the XML submitted from that >>> application from the submit history report. >>> >>> What are you using the APIs for? >>> >>> thanks, >>> Cory >>> >>> On Tue, Oct 6, 2015 at 3:03 PM, Ratchapong Kanaprach >> >>>> Hi, >>>> >>>> I've trouble with form submission. I don't know what are variables in >>>> the xml is required. Can you show me an example of XML that used to upload >>>> to https://www.commcarehq.org/a/demo/receiver/submission/ >>>> >>>> Thank you very much for your help. >>>> Best, >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "commcare-users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to commcare-user...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> You received this message because you are subscribed to the Google Groups >> "commcare-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to commcare-user...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > >