How to Publish to JSON Server with ODK Aggregate Publish

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?

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

2 Likes

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!

3 Likes

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.

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.

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?

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

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

@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.

1 Like

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!

@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?

Hello Sir,
Can you please assist on that?am still struggling

Hi Khalfan,

Yes, happy to help. Can you describe what problems you're having?

Best,

Taylor

2 Likes

I am not a programmer but I have been using ODK for couple of projects..I can design forms uploading to aggregate and collect with collector.My problem is to automate visualization of collected data...I see in aggregate option to push to json server but I don`t know how to set json server

I am having similar problem,I created a java http application deployed on tomcat server. but having "ACTIVE_PAUSE" from ODK Aggregate publish data status column. I will appreciate your help.

  1. Submissionsdata Class

public class Submissionsdata implements Serializable {
private String token;
private String content;
private String formId;
private String formVersion;
private String data;
.....
2. the endpoint
@PostMapping(/"datalist")
ResponseEntity processSubmissionTwo(@RequestBody Submissionsdata request)

We've seen this before, check out this thread: https://groups.google.com/forum/#!searchin/openfn/publisher$20stalling$20permanently|sort:date/openfn/u_fkGV60iqk/HqrS0LrABgAJ

Is that maybe what's going on?

And what are you publishing as? JSON? Or something else?