API endpoint for creating and removing links to external content

Hello!

I am looking for the api endpoint for external file resources to both add, update, and remove them.

When I looked at the network tab it seems to be communicating through an older struts framework. (.action)

2 Likes

Hi @Timothy_Harding1,

The DHIS2 API’s are accessible here;

The next page, go to the Web API and Click on Browse it here

It will load a list of API’s that you can use.

Let me know if this helps.

Best,
James.

2 Likes

Hello James and thank you for your response. I had actually tried that and was getting this 404:

image

This is the same on the 2.30 play demo site

and on 2.31.0

https://play.dhis2.org/2.31.0/api/externalFileResources

3 Likes

Hi @Timothy_Harding1, am not sure whether the endPoint works correctly. There are few constrained mentioned at Home - DHIS2 Documentation but a POST request should work.

3 Likes

Isaiah, I would imagine a GET request should list all the resources like the other endpoints. And I find it curious that the reports app doesn’t use a GET/POST to that endpoint, but rather:
https://tharding.baosystems.com/dhis-web-reporting/displayViewDocumentForm.action

So I wonder if these are even related?

The dashboard gets its list from:
https://tharding.baosystems.com/api/29/dashboards/q

image

3 Likes

Isaiah and James, it looks like it is the documents endpoint:

i.e.:
https://tharding.baosystems.com/api/documents/kV5jxjI71dP

Which you can pull here:

https://tharding.baosystems.com/api/30/metadata.xml?assumeTrue=false&format=xml&documents=true

4 Likes

This is nice, thank you for the resourceful updates @Timothy_Harding1 :smile:

Best,
James.

2 Likes