Hi Carlo
Thanks for posting here. Carlo contacted me directly but I asked him to post here so that we could share the answers and get the help of other people on the forum. One piece of information that Carlo did not include is that he wants to submit data from a mobile application.
So far, Carlo, everyone has used the client_helpers library functions in order to submit records to Indicia as shown in the documentation like this.
<?php
if ($_POST) {
$submission = data_entry_helper::build_sample_occurrence_submission($_POST);
$response = data_entry_helper::forward_post_to('save', $submission);
echo data_entry_helper::dump_errors($response);
}
?>
You can examine the source code itself to see exactly what is happening but it looks quite complicated to me and my impression has been that there is more complexity built in to the submission structure than is used so far.
The PlantTracker app posts from the app to an intermediate website (a Drupal website using the iForm module as there is also a web form). The intermediate website takes the post from the app and uses the functions above to forward the record to the Indicia warehouse. The website has to authenticate with the warehouse in order to submit the record but the app user does not log in at all. The records are not associated with a user ID and the person cannot read back their records.
Now the developers at Bristol University are building a new app where the user will be able to login. To do so the user first registers with the intermediate website and establishes a username and password. This website is still using Drupal and can use the EasyLogin module to automatically link the Drupal account to an Indicia user account. The mobile app will still submit records to the intermediate website and it will still forward them to the Warehouse but the app will authenticate with the intermediate website over an https connection and the record will be forwarded with an Indicia User ID.
Since the PlantTracker app needed a website too this was a very efficient solution to the problem. To interface directly with the warehouse you would need to write many of the functions of the client_helpers library within your app so that you could create users, authenticate them and send records. That sounds like quite hard work to me.
Some bits of documentation that might be relevant to logging in a user directly are the user_identifier/get_user_id service for creating users and the login control for authenticating users. Note that all the communication is done under the control of the digest authentication used normally between a website and a warehouse. For an app to do this it would need to have the 'website' password embedded within in it. That poses a modest security issue should the app be reverse engineered.
The developers at Bristol have said several times that they are happy to share their work. This could be very good for you if you are happy with the idea of submitting records via another website rather than direct to the Warehouse.
From this information, Carlo, can you say which method you would like to follow?
Regards,
Jim Bacon.