This commit is contained in:
@@ -8,9 +8,11 @@ You can access the api explorer console by navigating with your browser to this
|
||||
For example if your AyaNova server were located on port 7575 of the local computer you would connect to it via this url:
|
||||
`http://localhost:7575/api-docs/`
|
||||
|
||||
Using this console you can see real working examples of exactly what is required for headers and body contents of requests and the responses returned to use with your own development environment.
|
||||
|
||||
## Authentication
|
||||
|
||||
Most of the API endpoints in AyaNova require authentication to use them. The API console supports the ability to set a authorization token so you can fully test all routes.
|
||||
Most of the API endpoints in AyaNova require a [JSON web token](https://jwt.io/introduction/) authentication to use them. The API console supports the ability to set a authorization token so you can fully test all routes.
|
||||
|
||||
To obtain a token expand the "Auth" route in the main console and enter a value for login and password and click on the "Try it out" button to obtain an API token.
|
||||
|
||||
@@ -21,16 +23,16 @@ The "response body" section will contain the return value, something similar to
|
||||
"ok": 1,
|
||||
"issued": 1518034370,
|
||||
"expires": 1520626370,
|
||||
"token": "xyGhbGciOiJIUzI1NiIsInR4cCI6IkpXVCJ9.utJpYXQ4OiIxNqE4MDM0MzcfIiwiZXhwjjoiMTUyMDYyNjM8MCIsImlocyI0IkF53U5vdmEiLCJpZCI6IjEifQ.z7QaHKt2VbcysunIvsfa-51X7owB1EYcyhpkdkfaqzy",
|
||||
"token": "xyGhbGciOiJIUzI1NiIsInR4cCI6IkpXVCJ9.utJpqE4MDM0............fQ.z7QaHKt2VbcysunIvsfa-51X7owB1EYcyhpkdkfaqzy",
|
||||
"id": 1
|
||||
}
|
||||
```
|
||||
|
||||
The highlighted line above contains the token you require, copy the token value not including the quotation marks. This is your access token.
|
||||
The highlighted line above contains the token (shortened for illustration) you require, copy the token *value* not including the quotation marks. This is your access token.
|
||||
|
||||
Click on the "Authorize" button at the top of the API console and a popup dialog box will open. In the "Value" box the dialog enter your api token, for example using the above you would paste in:
|
||||
|
||||
`xyGhbGciOiJIUzI1NiIsInR4cCI6IkpXVCJ9.utJpYXQ4OiIxNqE4MDM0MzcfIiwiZXhwjjoiMTUyMDYyNjM8MCIsImlocyI0IkF53U5vdmEiLCJpZCI6IjEifQ.z7QaHKt2VbcysunIvsfa-51X7owB1EYcyhpkdkfaqzy`
|
||||
`xyGhbGciOiJIUzI1NiIsInR4cCI6IkpXVCJ9.utJpqE4MDM0............fQ.z7QaHKt2VbcysunIvsfa-51X7owB1EYcyhpkdkfaqzy`
|
||||
|
||||
then click on the "Authorize" button inside the popup dialog box.
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ The `value` property is usually a direct comparison type value such as a date or
|
||||
|
||||
In most cases tokens are for date ranges however there is one special token that applies to any data type `{[null]}`. When this token is specified as the `value` property value the list will be filtered by null (empty) values for all data types using the `op` comparison Equality operator `=` or in any other operator case it will be treated as if the operator was `!=` Not equal.
|
||||
|
||||
Tokens for date ranges generally provide a *relative* to the current moment (and time zone) pre-defined range of dates. This means the filter can be saved and re-used and the date range will always filter *relative* to the current date and time in the user's own time zone (as specified in their UserOptions object). So, for example, if two users are set to two different time zones they will get different results for some of these filters depending on whether that token is a relative one or absolute.
|
||||
Tokens for date ranges generally provide a *relative* to the current moment (and time zone) pre-defined range of dates. This means the filter can be saved and re-used and the date range will always filter *relative* to the current date and time in the *user's own time zone* (as specified in their UserOptions object). So, for example, if two users are set to two different time zones they will get different results for some of these filters depending on whether that token is a relative one or absolute.
|
||||
|
||||
For example the `{[past]}` token is relative to the current date and time but it is unaffected by any time zone considerations whereas the `{[yesterday]}` token takes into consideration the user's time zone when filtering.
|
||||
|
||||
@@ -121,6 +121,18 @@ These are the available tokens for date filters:
|
||||
| {[past90days]} | Include records where `fld` contains a date and time from now minus 90 days to now |
|
||||
| {[past30days]} | Include records where `fld` contains a date and time from now minus 30 days to now |
|
||||
| {[past24hours]} | Include records where `fld` contains a date and time from now minus 24 hours to now |
|
||||
| {[january]} | Include records where `fld` contains a date and time between 12:00 am January 1st this year and 12:00 am February 1st this year |
|
||||
| {[february]} | Include records where `fld` contains a date and time between 12:00 am February 1st this year and 12:00 am March 1st this year |
|
||||
| {[march]} | Include records where `fld` contains a date and time between 12:00 am March 1st this year and 12:00 am April 1st this year |
|
||||
| {[april]} | Include records where `fld` contains a date and time between 12:00 am April 1st this year and 12:00 am May 1st this year |
|
||||
| {[may]} | Include records where `fld` contains a date and time between 12:00 am May 1st this year and 12:00 am June 1st this year |
|
||||
| {[june]} | Include records where `fld` contains a date and time between 12:00 am June 1st this year and 12:00 am July 1st this year |
|
||||
| {[july]} | Include records where `fld` contains a date and time between 12:00 am July 1st this year and 12:00 am August 1st this year |
|
||||
| {[august]} | Include records where `fld` contains a date and time between 12:00 am August 1st this year and 12:00 am September 1st this year |
|
||||
| {[september]} | Include records where `fld` contains a date and time between 12:00 am September 1st this year and 12:00 am October 1st this year |
|
||||
| {[october]} | Include records where `fld` contains a date and time between 12:00 am October 1st this year and 12:00 am November 1st this year |
|
||||
| {[november]} | Include records where `fld` contains a date and time between 12:00 am November 1st this year and 12:00 am December 1st this year |
|
||||
| {[december]} | Include records where `fld` contains a date and time between 12:00 am December 1st this year and 12:00 am January 1st next year |
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user