← Back to team overview

dhis2-devs team mailing list archive

[d2 lib] - API call failing with "Server connection failed for API request"

 

Hi,
I'm using d2 to fetch some data inside a DHIS2 app. Everything looks to be
working well, until I have a query using event analytics.

As the d2 lib don't have models yet (I think) for this, I'm making direct
calls using get, for example:

return getInstance().then(d2 =>
d2.Api.getApi().get("events?program=jqKm7VLgdzL"))

This works perfectly, I see the query go through the network view, and the
values get back

Now I'm trying a event analytics query:

return getInstance().then(d2 =>
d2.Api.getApi().get("/25/analytics/events/query/jqKm7VLgdzL?stage=tbLC6IHktf0&dimension:ou:VAPI4p81HAz;LEVEL-6&displayProperty=NAME"));

And this show an error in the console with  "Server connection failed for
API request"

I've ran the query through the browser & Postman without any problems. I've
debugged, the authorization header is correct.

Any clue what could go wrong there?

Thanks!

Martin

-- 
*Martin Van Aken - **Freelance Enthusiast Developer*

Mobile : +32 486 899 652

Follow me on Twitter : @martinvanaken <http://twitter.com/martinvanaken>
Call me on Skype : vanakenm
Hang out with me : martin@xxxxxxxxxxxxxxxx
Contact me on LinkedIn : http://www.linkedin.com/in/martinvanaken
Company website : www.joyouscoding.com

Follow ups