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

Updated documentation for event functions API endpoint #32

Merged
merged 3 commits into from
Dec 4, 2019
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
17 changes: 16 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2193,6 +2193,7 @@ HTTP/1.1 200 Success
| Name | Type | Description |
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| type | String | Human readable type of a event function. |
| name | Object | Human-translatable-readable name for the event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
Expand All @@ -2210,6 +2211,7 @@ To create a new event function, send a `POST` request to `https://api.ewea.io/v1
| Name | Type | Description | Required |
| :---------: | :----: | :--------------------------------------------------------------------------------: | :------: |
| code | String | Unique human-readable given code of this event function. | false |
| type | String | Human readable type of a event function. | true |
| name | Object | Human-translatable-readable name for the event function. | true |
| description | Object | Human-translatable-readable description for the event function. | false |
| color | String | A color code(in hexadecimal format) used to differentiate event function visually. | false |
Expand All @@ -2223,6 +2225,7 @@ curl --request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <apiKey>' \
--data '{
"type": "Flood"
"code": "DBM",
"name": { "en": "Dead Bodies Management" },
"color": "#F9C5A7"
Expand All @@ -2236,6 +2239,7 @@ The response will be a `JSON object` with the standard event group attributes:
| Name | Type | Description |
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| type | String | Human readable type of a event function. |
| name | Object | Human-translatable-readable name for the event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
Expand All @@ -2250,6 +2254,7 @@ The response will be a `JSON object` with the standard event group attributes:
HTTP/1.1 201 Success
{
"_id": "5ddbbc871283e3131b2d41f4",
"type": "Flood",
"name": { "en": "Dead Bodies Management" },
"abbreviation": { "en": "DBM" },
"description": { "en": "" },
Expand Down Expand Up @@ -2280,6 +2285,7 @@ The response will be a `JSON object` with the standard event function attributes
| Name | Type | Description |
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| type | String | Human readable type of a event function. |
| name | Object | Human-translatable-readable name for the event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
Expand All @@ -2294,6 +2300,7 @@ The response will be a `JSON object` with the standard event function attributes
HTTP/1.1 200 Success
{
"_id": "5ddbbc871283e3131b2d41f4",
"type": "Flood",
"code": "DBM",
"name": { "en": "Dead Bodies Management" },
"description": { "en": "" },
Expand All @@ -2312,6 +2319,7 @@ To update existing event function, send a `PATCH` request to `https://api.ewea.i

| Name | Type | Description | Required |
| :---------: | :----: | :-------------------------------------------------------------: | :------: |
| type | String | Human readable type of a event function. | true |
| name | Object | Human-translatable-readable name for the event function. | true |
| description | Object | Human-translatable-readable description for the event function. | false |

Expand All @@ -2324,6 +2332,7 @@ curl --request PATCH \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <apiKey>' \
--data '{
"type": "Flood",
"name": { "en": "Dead Bodies Management" },
"description": { "en": "" },
}'
Expand All @@ -2336,6 +2345,7 @@ The response will be a `JSON object` with the standard event function attributes
| Name | Type | Description |
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| type | String | Human readable type of a event function. |
| name | Object | Human-translatable-readable name for the event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
Expand All @@ -2351,6 +2361,7 @@ HTTP/1.1 200 Success
{
"_id": "5ddbbc871283e3131b2d41f4",
"code": "DBM",
"type": "Flood",
"name": { "en": "Dead Bodies Management" },
"abbreviation": { "en": "DBM" },
"description": { "en": "" },
Expand Down Expand Up @@ -2380,6 +2391,7 @@ The response will be a `JSON object` with the standard event function attributes
| Name | Type | Description |
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| type | String | Human readable type of a event function. |
| name | Object | Human-translatable-readable name for the event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
Expand All @@ -2395,6 +2407,7 @@ HTTP/1.1 200 Success
{
"_id": "5ddbbc871283e3131b2d41f4",
"code": "DBM",
"type": "Flood",
"name": { "en": "Dead Bodies Management" },
"abbreviation": { "en": "DBM" },
"description": { "en": "" },
Expand All @@ -2404,7 +2417,7 @@ HTTP/1.1 200 Success
}
```

### List All EventFuntion
### List All EventFunction

To list all event functions, send a `GET` request to `https://api.ewea.io/v1/predefines/`.

Expand All @@ -2425,6 +2438,7 @@ The response will be a `JSON object` with a `data key`. The values in the `data
| :----------: | :----: | :--------------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event function. |
| name | Object | Human-translatable-readable name for the event function. |
| type | String | Human readable type of a event function. |
| abbreviation | Object | Human-translatable-readable abbreviation for the name of the event function. |
| description | Object | Human-translatable-readable description for the event function. |
| code | String | Unique human-readable given code of this event function. |
Expand All @@ -2439,6 +2453,7 @@ HTTP/1.1 200 Success
{
"data": [{
"_id": "5ddbbc871283e3131b2d41f4",
"type": "Flood",
"name": { "en": "Dead Bodies Management" },
"abbreviation": { "en": "DBM" },
"description": { "en": "" },
Expand Down