Skip to content

equipoimcre/kobo-connect

 
 

Repository files navigation

kobo-connect

Connect Kobo to anything.

Description

Synopsis: a dockerized python API that sends Kobo submissions and their attachments to other API-enabled applications, changing field names if necessary. It is basically an extension of the KoboToolbox REST Services.

Deatils: see the docs.

API Usage

EspoCRM

Using the kobo-to-espocrm endpoint, it is possible to save a Kobo submission as one or more entities in EspoCRM.

Step by step:

  1. Define which questions in the Kobo form need to be saved in which entity and field.
  2. Create a new Kobo REST Service.
  3. Insert as Endpoint URL https://kobo-connect.azurewebsites.net/kobo-to-espocrm.
  4. For each question, add a Custom HTTP Header that specifies to which entity and field it corresponds to.

Nota bene:

  • The header name (left) must correspond to the Kobo column name (not label).
  • The header value (right) must correspond to the EspoCRM entity name, followed by a dot (.), followed by the field name.
  • The headers targeturl and targetkey, corresponding to the EspoCRM URL and API Key respectively, must be included as well.

121

Using the kobo-to-121 endpoint, it is possible to save a Kobo submission as a Person Affected (PA) registration in the 121 Portal.

Step by step:

  1. Define which questions in the Kobo form need to be saved in which field.
  2. Create a new Kobo REST Service.
  3. Insert as Endpoint URL https://kobo-connect.azurewebsites.net/kobo-to-121.
  4. For each question, add a Custom HTTP Header that specifies to which entity and field it corresponds to.
    • The header name (left) must correspond to the Kobo column name (not label).
    • The header value (right) must correspond to the field name in 121.

Special Headers:

  • The headers url121 is required and corresponds the the url of the 121 instance (without trailing /, so e.g. https://staging.121.global)
  • Headers username121 and password121, corresponding to the 121 username and the 121 password respectively, must be included as well.
  • If programid is included as a (select one) question, the XML Value of the question in kobo needs to be the corresponding number in the 121 portal, the label can be something else, see below programId
  • If programid is not included as a question, it needs to be added to the header as a number

See below for an example configuration, in which programId was not included as a question so it is included in the header.

Generic endpoint

See the docs.

Run locally

pip install -r requirements.txt
uvicorn main:app --reload

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.9%
  • Dockerfile 4.1%