Creating cases via the API

Hi Folks,

I'm scoping out using Commcare for gathering data from the field for an
Indian NGO.

They'd like to use Commcare more as task based model than a case based
model. I.e., predefined tasks are bulk uploaded into Commcare via the API
and certain mobile users have to complete certain tasks and enter some data
about that task.

I think the cases model can be adapted to this workflow, e.g., one simple
case per task. But I want to check whether:

a) Does the submission API (*) support creating/modifying cases?
This page on casexml20 https://github.com/dimagi/commcare/wiki/casexml20
suggests yes.
The importing cases via excel
https://confluence.dimagi.com/display/commcarepublic/Importing+Cases+Using+Excel page
shows it is definitely possible via the CommcareHQ web portal, but we'd
rather automate it by using the API.

b) If not, would it be possible to upload a form per task via the API?
In this case, is it possible to make some forms only visible to some
users?
After new forms are created, is it necessary to publish a new version of
the app to have them picked up?

c) Any other general advice on using Commcare mobile apps as task trackers?

Thank you!

  • Doug.

(*) I'm aware that API use requires a basic software plan.

Hey Doug,

You can use the submission API to create and modify cases (you just need to
craft appropriate XML forms). You can use multiple forms to create all the
tasks you need (making sure you assign them to the correct users with all
the correct case properties).

Its probably easier to use the importing cases page though and it would be
great if you could add a Uservoice request (dimagi.uservoice.com) to make
something like that available through the API.

Feel free to email me offline if you want to get into the technical details
of how to use our submission API correctly.

Sheel

··· On Wed, Mar 18, 2015 at 12:23 PM, Douglas Aberdeen wrote:

Hi Folks,

I'm scoping out using Commcare for gathering data from the field for an
Indian NGO.

They'd like to use Commcare more as task based model than a case based
model. I.e., predefined tasks are bulk uploaded into Commcare via the API
and certain mobile users have to complete certain tasks and enter some data
about that task.

I think the cases model can be adapted to this workflow, e.g., one simple
case per task. But I want to check whether:

a) Does the submission API (*) support creating/modifying cases?
This page on casexml20
https://github.com/dimagi/commcare/wiki/casexml20 suggests yes.
The importing cases via excel
https://confluence.dimagi.com/display/commcarepublic/Importing+Cases+Using+Excel page
shows it is definitely possible via the CommcareHQ web portal, but we'd
rather automate it by using the API.

b) If not, would it be possible to upload a form per task via the API?
In this case, is it possible to make some forms only visible to some
users?
After new forms are created, is it necessary to publish a new version of
the app to have them picked up?

c) Any other general advice on using Commcare mobile apps as task trackers?

Thank you!

  • Doug.

(*) I'm aware that API use requires a basic software plan.

--
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.

--
Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah

Thanks Sheel!

That's all the reassurance I needed for now.

When you say using the importing cases page through an API, do you mean
something like creating an API endpoint that accepts CSV defined cases
rather than XForm XML?

··· On 18 March 2015 at 22:45, Sheel Shah wrote:

Hey Doug,

You can use the submission API to create and modify cases (you just need
to craft appropriate XML forms). You can use multiple forms to create all
the tasks you need (making sure you assign them to the correct users with
all the correct case properties).

Its probably easier to use the importing cases page though and it would be
great if you could add a Uservoice request (dimagi.uservoice.com) to make
something like that available through the API.

Feel free to email me offline if you want to get into the technical
details of how to use our submission API correctly.

Sheel

On Wed, Mar 18, 2015 at 12:23 PM, Douglas Aberdeen < doug.aberdeen@gmail.com> wrote:

Hi Folks,

I'm scoping out using Commcare for gathering data from the field for an
Indian NGO.

They'd like to use Commcare more as task based model than a case based
model. I.e., predefined tasks are bulk uploaded into Commcare via the API
and certain mobile users have to complete certain tasks and enter some data
about that task.

I think the cases model can be adapted to this workflow, e.g., one simple
case per task. But I want to check whether:

a) Does the submission API (*) support creating/modifying cases?
This page on casexml20
https://github.com/dimagi/commcare/wiki/casexml20 suggests yes.
The importing cases via excel
https://confluence.dimagi.com/display/commcarepublic/Importing+Cases+Using+Excel page
shows it is definitely possible via the CommcareHQ web portal, but we'd
rather automate it by using the API.

b) If not, would it be possible to upload a form per task via the API?
In this case, is it possible to make some forms only visible to some
users?
After new forms are created, is it necessary to publish a new version
of the app to have them picked up?

c) Any other general advice on using Commcare mobile apps as task
trackers?

Thank you!

  • Doug.

(*) I'm aware that API use requires a basic software plan.

--
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.

--
Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/commcare-users/Ia5oCXs2_WA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hey Douglas,

Yup, that's the general idea - we'll work out the details if and when we
choose to build the functionality (based on the Uservoice idea). For now
the submission API is the way to achieve what you need.

Thanks,
Sheel

··· On Wed, Mar 18, 2015 at 1:22 PM, Douglas Aberdeen wrote:

Thanks Sheel!

That's all the reassurance I needed for now.

When you say using the importing cases page through an API, do you mean
something like creating an API endpoint that accepts CSV defined cases
rather than XForm XML?

On 18 March 2015 at 22:45, Sheel Shah sshah@dimagi.com wrote:

Hey Doug,

You can use the submission API to create and modify cases (you just need
to craft appropriate XML forms). You can use multiple forms to create all
the tasks you need (making sure you assign them to the correct users with
all the correct case properties).

Its probably easier to use the importing cases page though and it would
be great if you could add a Uservoice request (dimagi.uservoice.com) to
make something like that available through the API.

Feel free to email me offline if you want to get into the technical
details of how to use our submission API correctly.

Sheel

On Wed, Mar 18, 2015 at 12:23 PM, Douglas Aberdeen < doug.aberdeen@gmail.com> wrote:

Hi Folks,

I'm scoping out using Commcare for gathering data from the field for an
Indian NGO.

They'd like to use Commcare more as task based model than a case based
model. I.e., predefined tasks are bulk uploaded into Commcare via the API
and certain mobile users have to complete certain tasks and enter some data
about that task.

I think the cases model can be adapted to this workflow, e.g., one
simple case per task. But I want to check whether:

a) Does the submission API (*) support creating/modifying cases?
This page on casexml20
https://github.com/dimagi/commcare/wiki/casexml20 suggests yes.
The importing cases via excel
https://confluence.dimagi.com/display/commcarepublic/Importing+Cases+Using+Excel page
shows it is definitely possible via the CommcareHQ web portal, but we'd
rather automate it by using the API.

b) If not, would it be possible to upload a form per task via the API?
In this case, is it possible to make some forms only visible to some
users?
After new forms are created, is it necessary to publish a new version
of the app to have them picked up?

c) Any other general advice on using Commcare mobile apps as task
trackers?

Thank you!

  • Doug.

(*) I'm aware that API use requires a basic software plan.

--
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.

--
Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah

--
You received this message because you are subscribed to a topic in the
Google Groups "commcare-users" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/commcare-users/Ia5oCXs2_WA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
commcare-users+unsubscribe@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.

--
Sheel Shah
Project Manager | Dimagi
m: +1.781.428.5419 | skype: sheel_shah