Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tijsziere authored Dec 20, 2024
2 parents 6fccb26 + dede429 commit f8d0bb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ See below for an example configuration, in which programId was not included as a
## Create headers endpoint
If you need to map a lot of questions, creating the headers manually is cumbersome. The `/create-kobo-headers` endpoint automates this. It expects 4 query parameters:
- `system`: required, enum (options: 121, espocrm, generic)
- `kobouser`: your Kobo username
- `kobopassword`: your Kobo password
- `koboassetId `: the assed id of the survey (to be found in the url: https://kobonew.ifrc.org/#/forms/`ASSETID`/summary)
- `koboassetId`: the asset id of the survey (to be found in the url: https://kobonew.ifrc.org/#/forms/`ASSETID`/summary)
- `kobotoken`: the kobo token of the account the survey is available at (Click on 'account' icon top right > Account Settings > Security > API Key shown is the kobotoken)
- `hookId `:

In the body you can pass all the headers you want to create as key value pairs, for example:
```json
Expand All @@ -152,6 +152,8 @@ Tip: When you have the headers (/mapping) for example in an Excel table, you can
5. Execute the script and confirm that a new REST service in Kobo has been created with the correct headers.


Tip: When you have the headers (/mapping) for example in an Excel table, you can copy that into ChatGPT and ask it to transform the table to key value pairs. It might save time setting up the body needed.

This endpoint assumes the IFRC Kobo server (`https://kobonew.ifrc.org`)

## Generic endpoint
Expand Down
1 change: 0 additions & 1 deletion routes/routes121.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ async def kobo_to_121(request: Request, dependencies=Depends(required_headers_12


url = f"{request.headers['url121']}/api/programs/{programid}/registrations"

# POST to 121 import endpoint
import_response = requests.post(
url,
Expand Down

0 comments on commit f8d0bb2

Please sign in to comment.