HABTec / public-dashboard

0 stars 1 forks source link

Add Orgunit filter for all chart types #8

Closed redet-G closed 2 months ago

redet-G commented 3 months ago

/organisationUnits/PweZnUvvtxv?fields=children%5Bid%2Cpath%2CdisplayName%5D

RihanaE commented 3 months ago

This path is giving me 404 error. “organisationUnits/PweZnUvvtxv?fields=children%5Bid%2Cpath%2CdisplayName%5D "

On 19 Jun 2024, at 17:15, Redet Getachew @.***> wrote:

organisationUnits/PweZnUvvtxv?fields=children%5Bid%2Cpath%2CdisplayName%5D

redet-G commented 3 months ago

This is just to show you how you may use the API. Replace {id of the orgunit } with the id of the orgunit you want to browse in

/api/organisationUnits/{id of the orgunit}?fileds=children[id, path, displayName]

You can find the id of the orgunit by hitting the following endpoint

/api/me?fields=dataViewOrganisationUnits

When you hit this endpoint it will return the following JSON. From this, you have use dataViewOrganisationUnits.id as the root orgunit from which you can expand to child orgunits


{
  "dataViewOrganisationUnits": [
    {
      "id": "b3aCK1PTn5S"
    }
  ]
}
RihanaE commented 3 months ago

Oh okay. Thank you for the explanation

On Mon, Jun 24, 2024, 1:46 PM Redet Getachew @.***> wrote:

This is just to show you how you may use the API. Replace {id of the orgunit } with the id of the orgunit you want to browse in

/api/organisationUnits/{id of the orgunit}?fileds=children[id, path, displayName]

You can find the id of the orgunit by hitting the following endpoint

/api/me?fields=dataViewOrganisationUnits

When you hit this endpoint it will return the following JSON. From this, you have use dataViewOrganisationUnits.id as the root orgunit from which you can expand to child orgunits

{ "dataViewOrganisationUnits": [ { "id": "b3aCK1PTn5S" } ] }

— Reply to this email directly, view it on GitHub https://github.com/HABTec/public-dashboard/issues/8#issuecomment-2186261720, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2QWLTGTG3K5BSKIVJEHQS3ZI72G7AVCNFSM6AAAAABIRGM7WKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBWGI3DCNZSGA . You are receiving this because you were assigned.Message ID: @.***>

RihanaE commented 3 months ago

This path is giving me a 404, “Not Found" error. “https://hmis.dhis.et/api/40/organisationUnits/PweZnUvvtxv?fields=children%5Bid%2Cpath%2CdisplayName%5D "

On 19 Jun 2024, at 17:15, Redet Getachew @.***> wrote:

organisationUnits/PweZnUvvtxv?fields=children%5Bid%2Cpath%2CdisplayName%5D

redet-G commented 3 months ago

The root orgunit id should be b3aCK1PTn5S

redet-G commented 3 months ago

There is no orgunit with that id(PweZnUvvtxv) that is why it is returing 404

redet-G commented 2 months ago

d537ff8