Data Value Sets Fetch API Support for Start and End Date Query Parameters(DHIS2 Language Pack)

14 views
Skip to first unread message

Chaiwa Berian

unread,
Jul 4, 2018, 5:30:37 PM7/4/18
to OpenFn Community

Dear OpenFn Users,

I am wondering whether the use of startDate and endDate query parameters are being supported by the fetchData API. I tried the below configuration and I am only getting an empty({}) response:

fetchData(
{
 fields
:
 
{
   dataSet
: 'MVccvKD4o8Q',
   orgUnit
: 'Gmn6FKMQQ13',
   startDate
: '2017-01-01',
   endDate
: '2018-01-01'
 
},
 
postUrl: "https://www.openfn.org/inbox/id_for_my_inbox"
})

Taylor Downs

unread,
Jul 7, 2018, 4:53:22 AM7/7/18
to Chaiwa Berian, OpenFn Community
Hey Chaiwa,

I'm away from my computer right now, but in looking at https://github.com/OpenFn/language-dhis2/blob/master/src/Adaptor.js on my phone, I can see that the params you pass are attached as query params for a get request to DHIS2, as per the DHIS2 web API spec here: https://docs.dhis2.org/2.22/en/developer/html/ch01s13.html#d5e1642

According to DHIS2, you should be able to pass startDate and endDate. Is this the only param that doesn't seem to be working for you?

Taylor

--
You received this message because you are subscribed to the Google Groups "OpenFn Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openfn+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openfn/3a6f8ffc-e3a8-400e-a004-833b6fc66d27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

chaiwa.berian

unread,
Jul 7, 2018, 7:36:52 AM7/7/18
to Taylor Downs, OpenFn Community
Hi Taylor,
You could be right, what is strange though is that if I just pass Period: '201705' or any other month with Period parameter, I get the data. What I am failing to understand is why I can't get the data whenever I specify the range of dates with startDate and endDate params!

Thanks and kind regards,
Chaiwa.



Sent from my Samsung Galaxy smartphone.
Reply all
Reply to author
Forward
0 new messages