diff --git a/README.md b/README.md index 8174ea2..42b5f3c 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 diff --git a/routes/routes121.py b/routes/routes121.py index c747ec5..9684363 100644 --- a/routes/routes121.py +++ b/routes/routes121.py @@ -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,