How to Publish to JSON Server with ODK Aggregate Publish

odk-aggregate

(Jefferson Francisco) #1

I am trying to use ODK Aggregate to publish data to a JSON server, but I can't find any documentation for that type of implementation.

Could anyone point me in the right direction for learning how to do this?


(Matthew White) #2

I've used the simple JSON publisher in the past. You can find documentation on that here. Let us know how it goes!


(Taylor Downs) #3

I've used the JSON publisher in dozens of implementations over the last few years and I'm happy to help out. Don't hesitate to reach out if you've got any specific questions or hit a snag!


(Dedrick Kitamuka) #4

Hello, I am trying to use it now. I have implemented a server to received published data.
The problem is when I receive data I am sending a 201 code to aggregate to inform that everything is OK but aggregate keeps sending the same data. It seems like aggregate does not understand the http code 201.


(Aleksa Krolls) #5

Are you still running into issues? I have worked on several ODK implementations and have experience troubleshooting publishing and integration issues when connecting with other databases. I would be happy to help.


(Dedrick Kitamuka) #6

Hello @aleksa-krolls

I am sending back 200 code now and it seems fine but sometimes aggregate sends the same data again. I am dealing with the instance_uuid column to avoid duplicate record, do you have another idea?


(Aleksa Krolls) #7

@DedrickEnc Have you tried adjusting the "Data to Publish" settings if leveraging the ODK Aggregate publisher?


(Carlos Rivas S) #9

Hi Aleksa, could you help me on this, I want to publish on JSON but haven´t found enough documentation.


(Aleksa Krolls) #10

@Carlos_Rivas_PMA In Aggregate...

  1. Go to Forms Management > Publish and then pick one of the JSON publishing options (e.g., Z-Alpha JSON Server)
  2. Choose which data to publish in the "Data to Publish:" picklist. You may: "Upload Existing Data ONLY", "Stream New Submission Data ONLY", or "BOTH Upload Existing & Stream New Submission Data".
  3. In the "URL to publish to:" text box, enter your the endpoint you are publishing to
  4. "Authorization token" may/ may not be required depending on where you are publishing to
  5. Click "Publish" and enter your email address in the dialogue box
  6. Click the "Published Data" tab under "Form Management" and select your form to view the status of your publisher. You can also now check your OpenFn inbox to see ODK submissions arrive.

You can also see what this process looks like in this video, where we are publishing ODK JSON data to OpenFn.


(Carlos Rivas S) #11

Thank you Aleksa for your clarification, and maybe this is a crucial part of the workflow that needs attention to document, i.e. how to set up a proper JSON server for using with ODK or what other options are available in the market.
Thanks again Aleksa!


(Aleksa Krolls) #12

@Carlos_Rivas_PMA Well this depends on the service/API you're trying to publish the ODK data to. Do you have a specific app/system in mind that you're hoping to integrate with? Or are setting this up more for demo purposes?