Hello folks --
I am in a situation where we are considering doing a bit of integration
between our commcare project and a third-party web application (PHP/mySQL)
that might, in certain circumstances, want to connect with the commcareHQ
API, authenticate itself as a given user, and basically issue some commands
to submit one form of a type that we have already of course defined and are
making use of in our app. Furthermore, that form, that we'd like this
other app to complete and submit via the API, has its case management set
up so that it requires an existing case, as well as in some conditions will
create a new case of a different case type.
I am not the programmer that will do this coding, but I do want to be
oriented as to the basic sections of the API documentation apply to the
various steps, so that I can get this programmer (who doesn't know
commcare) at least ... oriented to start off with.
I am looking at the table of about 20 APIs that I see listed
on CommCare HQ APIs - CommCare Public - CommCare Public.
I'm a little bit uncertain about which API will be able to concretely carry
out the following steps. I was hoping that someone could look at my crude
list of expected steps below, and tell me which API has the commands to
allow these to be invoked for that step. Sorry if this seems needy or even
wrong-headed -- it will just make it easier for me to be confident that I'm
basically oriented, and also to start my team off in the right mindset.
This PHP application, after having collected a bunch of information in its
own forms and variables, will then hopefully carry out these steps. For
each one of these, can you tell me which API our programmer should look at
to start learning how to make it happen? Again, sorry if this seems
painfully obvious to you:
1-- the third party app makes a call to authenticate itself as a given
user, using its password ---> ________ api
[Now we ultimately want to complete a form whose name is "C1 Referral
Followup" which however requires the selection of an existing case for
which to complete the form. Therefore:]
2-- Their app asks the commcare system for the list of cases that the
logged-in user has available to them that are allowed for that C1 Referral
Followup form. (in other words, the list of available cases that the user
is normally presented with when they go to the C1 form on the normal mobile
phone app.) ... so that their web app can then present that list to the
user and allow them to select one of them. ----> __________ api
3-- Their app takes a number of fields/variables that they have already
collected from the user, and transmits that data to the CommCareHQ server,
specifying which of the C1 form's fields are being populated with what
pieces of data, and resulting in the form being fully submitted and saved
to the CommCareHQ server. ---> ______ api
4-- The CommCareHQ system, which has already been configured in its case
management that under certain circumstances a new case should be created
and passing certain values to the new case, does that as normal --- Does
that process happen automatically in the CommCareHQ app since the Case
Management for that form has been specified right there on the CommCareHQ
server? (I hope!) Or does the remote web app need to invoke something for
that additional case to be created?
5-- And just to be clear, the other existing case management configurations
on CommCareHQ will also handle the data submitted themselves, right? no
additional things that the remote app would have to do for that to happen?
6-- Do you have any other notes, or things that I should flag, about
possible complexities in the story that I just told above?
Thanks much for your inputs here, this will set me off on the right foot.
Eric