Using Data API to get Organizational Structure


(Myers) #1

I know we can download the Organizational Structure to an Excel, but I’m hoping this is also possible with the Data API. I havent’ seen this option in the documentation though.

Ralph


(Ethan Soergel) #2

Hi Ralph,

There is also an API for the project organization, though it doesn’t appear to be documented on the wiki. I’ll see about getting that added. It accepts options similar to the other APIs, such as format=json, limit=10, and offset=10.

The relevant URLs are:

List of locations: https://www.commcarehq.org/a//api/v0.5/location/

Individual location: https://www.commcarehq.org/a//api/v0.5/location/<location_id>

List of organization levels: https://www.commcarehq.org/a//api/v0.5/location_type/

Individual location level: https://www.commcarehq.org/a//api/v0.5/location_type/<location_type_id>