Skip to content

Commit

Permalink
Docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
grayhound committed Jun 12, 2018
1 parent d37c6b0 commit b6e1535
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 53 deletions.
4 changes: 1 addition & 3 deletions source/endpoints/measurements/last.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ Get last measurement
8.893,
9.414
],
"recieved": "2017-06-15T11:20:43.940Z",
"created": "2018-03-26T11:22:23.828Z",
"measurementgroup": "7b9dca62-47c2-488b-9ad2-66f394c43243"
"created": "2018-03-26T11:22:23.828Z"
}

**Unauthorized response**
Expand Down
39 changes: 16 additions & 23 deletions source/endpoints/measurements/list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ Get list of measurements
4.037,
5.42
],
"recieved": "2017-11-04T05:32:26.348Z",
"created": "2018-03-26T11:22:23.811Z",
"measurementgroup": "d25a3495-791a-47a1-b647-cc164a88973b"
"created": "2018-03-26T11:22:23.811Z"
},
{
"id": "5ab8d7effa631a239c2b1a50",
Expand All @@ -42,13 +40,11 @@ Get list of measurements
4.126,
4.535
],
"recieved": "2018-01-22T14:20:59.338Z",
"created": "2018-03-26T11:22:23.811Z",
"measurementgroup": "07f215ff-c3f2-47cc-84d2-dc67ae022859"
"created": "2018-03-26T11:22:23.811Z"
},
],
"count": 1000,
"pages": 20
"next": "5b1e58bdf670201dd0272886",
"prev": null
}

**Unauthorized response**
Expand All @@ -59,23 +55,20 @@ Get list of measurements

Unauthorized

:query page: used for pagination. Default is 1.
:query type: filter by type.
:query sort: sorting parameter.

You must provide string with sorting field name and sorting type like this:
:jsonparam string next: Next measurement. Used for pagination.
:jsonparam string prev: Prev measurement. Used for pagination.

`type,asc`

Available fields:
- `created` - sort by creation date
- `type` - sort by measurement type
- `value` - sort by values. In this case it sorts by 3 values presented in order, so first value is always primary in this sorting.
Available sort types:
- `asc` - Ascending sort
- `desc` - Descending sort
:query next: Use `next` or `prev` fields from response to get next or previous page.
:query type: filter by type.

:reqheader Authorization: Bearer token from authentication.
:reqheader Content-Type: application/json
:statuscode 200: No errors, will return result with sensors list.
:statuscode 401: User is not authorized - token is incorrect or outdated.
:statuscode 401: User is not authorized - token is incorrect or outdated.

:statuscode 422: Validation error.

**Possible validation errors and codes:**

- `code=1` - `field=sensor_id` - `This is not correct id format.`.
- `code=2` - `field=next` - `This is not correct id format.`.
4 changes: 1 addition & 3 deletions source/endpoints/sensors/measurements/last.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ Get last measurement for sensor
8.893,
9.414
],
"recieved": "2017-06-15T11:20:43.940Z",
"created": "2018-03-26T11:22:23.828Z",
"measurementgroup": "7b9dca62-47c2-488b-9ad2-66f394c43243"
"created": "2018-03-26T11:22:23.828Z"
}

**Unauthorized response**
Expand Down
40 changes: 16 additions & 24 deletions source/endpoints/sensors/measurements/list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ Get measurements for sensor
6.263,
5.205
],
"received": "2017-05-27T06:46:55.733Z",
"created": "2018-03-26T11:22:23.812Z",
"measurementgroup": "072b5d22-33d0-41e2-899f-a7c296f04edd"
"created": "2018-03-26T11:22:23.812Z"
},
{
"id": "5ab8d7effa631a239c2b1b6d",
Expand All @@ -42,13 +40,11 @@ Get measurements for sensor
7.688,
1.196
],
"received": "2018-01-12T09:31:19.804Z",
"created": "2018-03-26T11:22:23.839Z",
"measurementgroup": "a0364248-e200-4f13-a5d0-29637f882b40"
"created": "2018-03-26T11:22:23.839Z"
},
],
"count": 5,
"pages": 1
"next": "5b1e58bdf670201dd0272886",
"prev": null
}

**Unauthorized response**
Expand All @@ -59,24 +55,20 @@ Get measurements for sensor

Unauthorized

:query page: used for pagination. Default is 1.
:query type: filter by type.

:query sort: sorting parameter.

You must provide string with sorting field name and sorting type like this:

`type,asc`
:jsonparam string next: Next measurement. Used for pagination.
:jsonparam string prev: Prev measurement. Used for pagination.

Available fields:
- `created` - sort by creation date
- `type` - sort by measurement type
- `value` - sort by values. In this case it sorts by 3 values presented in order, so first value is always primary in this sorting.
Available sort types:
- `asc` - Ascending sort
- `desc` - Descending sort
:query next: Use `next` or `prev` fields from response to get next or previous page.
:query type: filter by type.

:reqheader Authorization: Bearer token from authentication.
:reqheader Content-Type: application/json
:statuscode 200: No errors, will return result with sensors list.
:statuscode 401: User is not authorized - token is incorrect or outdated.
:statuscode 401: User is not authorized - token is incorrect or outdated.

:statuscode 422: Validation error.

**Possible validation errors and codes:**

- `code=1` - `field=sensor_id` - `This is not correct id format.`.
- `code=2` - `field=next` - `This is not correct id format.`.

0 comments on commit b6e1535

Please sign in to comment.