Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#9194): add api doc for getting place by UUID #1423

Merged
merged 5 commits into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions content/en/apps/reference/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,120 @@ Content-Type: application/json
}
```

## Place

### GET /api/v1/place/{{uuid}}

*Added in 4.10.0*

Returns a place's data in JSON format.

#### Permissions

`can_view_contacts`

#### Query parameters

| Name | Required | Description |
|--------------|----------|------------------------------------------------------------------------------------------------|
| with_lineage | false | If "true", the place's parent lineage will be included in the returned data. Default is "false". |

#### Examples

Get a place by uuid:

```
GET /api/v1/place/d9153705-4574-43c3-b945-71aa2164d1d6
```

```
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
"_id": "d9153705-4574-43c3-b945-71aa2164d1d6",
"_rev": "2-5f5fde4a8def0f40f89bd164d93bed4f",
"parent": {
"_id": "b935ef10-0339-4263-99fc-34d4f8d72891"
},
"type": "health_center",
"name": "Example Health Center",
"contact": {
"_id": "f512e1d8-841b-4bc1-8154-b6794755f45b",
"parent": {
"_id": "d9153705-4574-43c3-b945-71aa2164d1d6",
"parent": {
"_id": "b935ef10-0339-4263-99fc-34d4f8d72891"
}
}
},
"reported_date": 1708453778059,
"place_id": "17437"
}
```

Get a place by uuid with lineage:

```
GET /api/v1/place/d9153705-4574-43c3-b945-71aa2164d1d6?with_lineage=true
```

```
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
"_id": "d9153705-4574-43c3-b945-71aa2164d1d6",
"_rev": "2-5f5fde4a8def0f40f89bd164d93bed4f",
"parent": {
"_id": "b935ef10-0339-4263-99fc-34d4f8d72891",
"_rev": "2-bdea703bfec184085c31a6bab022764f",
"parent": "",
"type": "district_hospital",
"name": "Example Health Facility",
"contact": {
"_id": "e5237f20-2d28-4272-8006-c4903e032ab4",
"_rev": "3-5a0a8e95cef8bafc186a9494c75afb3c",
"type": "person",
"name": "Example Supervisor",
"date_of_birth": "2002-02-20",
"phone": "+254712345678",
"sex": "female",
"role": "chw_supervisor",
"reported_date": 1708453756441,
"parent": {
"_id": "b935ef10-0339-4263-99fc-34d4f8d72891"
},
"patient_id": "20424"
},
"reported_date": 1708453756440,
"place_id": "54380"
},
"type": "health_center",
"name": "Example Health Center",
"contact": {
"_id": "f512e1d8-841b-4bc1-8154-b6794755f45b",
"_rev": "3-9dbc362b262f88d63f270fe06a94dfe8",
"type": "person",
"name": "Example CHW",
"date_of_birth": "2002-02-20",
"phone": "+254712345679",
"sex": "female",
"role": "chw",
"reported_date": 1708453778059,
"parent": {
"_id": "d9153705-4574-43c3-b945-71aa2164d1d6",
"parent": {
"_id": "b935ef10-0339-4263-99fc-34d4f8d72891"
}
},
"patient_id": "74615"
},
"reported_date": 1708453778059,
"place_id": "17437"
}
```

## Places

By default any user can create or modify a place.
Expand Down
Loading