Closed redet-G closed 2 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
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"
}
]
}
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: @.***>
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
The root orgunit id should be b3aCK1PTn5S
There is no orgunit with that id(PweZnUvvtxv
) that is why it is returing 404
/organisationUnits/PweZnUvvtxv?fields=children%5Bid%2Cpath%2CdisplayName%5D