wisper service API documentation version 1
http://v1.api.wisper.com
/
/man
- contains manual information
- raml have not specification to describe media type of response for different than main media type. so media type must be
application/html
,application/image
or anything else, not onlyapplication/json
/oauth
- allow authenticate using
oauth-2
- allow create account by
google oauth-2
get /oauth/provider
HTTP status code 200
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "^[a-zA-Z0-9 ]{16}$"
},
"url": {
"type": "string"
}
}
}
Example:
{
"name": "google",
"url": "https://accounts.google.com/o/oauth2/auth?scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fplus.me%20profile%20email&approval_prompt=auto&response_type=code&client_id=327834646153-27e424bo1lpofea0lkfs8bvrf7sv5j2e.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A9001%2Fv1%2Foauth%2Flogin"
}
- this is not real resource
- this is endpoint which oauth provider call to transfer code after authenticate successful
get /oauth/login
- this is not real resource
- this is endpoint which oauth provider call to transfer code after authenticate successful
Query Parameters
- code: required (string )
- string code returned from provider
- use to exchange token with provider
Example:
4/Xq544hgidn4FWIbhAUHjIvk8xcrBHhWA2d_OUC-Rklo
HTTP status code 303
returned query parameters in location header
- access_token: credential for authenticate
- expiry_date: unix time when access_token is invalid
- refresh_token: credential to exchange new access_token
Headers
- Location: (string )
Example:
http://wisper.com/oauth/login?access_token=ya29.CjBXA7n45pVDdY99_Xw4uBjiXoM_5xXls7epUPWqJtyds9p18_nqI3dBkmpiNkozpD0&refresh_token=1/IhkDruwBVFu28YGMPlezO0SeFEmLLEER45YHW_wUarY?expiry_date=1473264922399
- exchange
refresh_token
to get newaccess_token
refresh_token
store at server, and it identity byaccess_token
in requests header, authorization field
get /oauth/token
- exchange
refresh_token
to get newaccess_token
refresh_token
store at server, and it identity byaccess_token
in requests header, authorization field
HTTP status code 200
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"access_token": {
"type": "string"
}
}
}
Example:
{
"access_token": "ya29.CjBXA7n45pVDdY99_Xw4uBjiXoM_5xXls7epUPWqJtyds9p18_nqI3dBkmpiNkozpD0"
}
HTTP status code 401
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "must login to refresh access token"
}
HTTP status code 404
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "not found refresh token"
}
/me
- retrieve, update information of current login user
get /me
HTTP status code 200
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9]{24}$"
},
"displayName": {
"type": "string"
},
"image": {
"type": "url"
},
"language": {
"type": "string",
"pattern": "^[a-z]{2}$"
}
}
}
Example:
{
"id": "57cfe654b7a2ca35c46b0935",
"image": "https://lh3.googleusercontent.com/--o4qX1JMQM4/AAAAAAAAAAI/AAAAAAAAABQ/4PHBBthftbU/photo.jpg?sz=50",
"language": "en",
"displayName": "kevin leptons"
}
HTTP status code 401
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "must login to retrieve information of account"
}
- update current using of scheduler
- after that, service will add scheduler to collection scheduler of account in
schedulers
field
- remove scheduler from collection of schedulers of account
put /me/scheduler/{id}
- update current using of scheduler
- after that, service will add scheduler to collection scheduler of account in
schedulers
field
URI Parameters
- id: required (string - pattern: ^[a-z0-9]{24}$)
Example:
57c80ebf0741aaca38f66ad0
HTTP status code 204
HTTP status code 401
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "must login to update scheduler"
}
HTTP status code 404
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "not found scheduler to use"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "id must be objectid"
}
delete /me/scheduler/{id}
- remove scheduler from collection of schedulers of account
URI Parameters
- id: required (string - pattern: ^[a-z0-9]{24}$)
Example:
57c80ebf0741aaca38f66ad0
HTTP status code 204
HTTP status code 401
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "must login to remove scheduler from collection"
}
HTTP status code 404
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "not found scheduler to remove"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "id must be objectid"
}
put /me/region
Query Parameters
- id: required (string - pattern: ^[a-z]{2}$)
Example:
en
HTTP status code 204
HTTP status code 401
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "must login to update region"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "id must be two lowercase characters"
}
/region
- region was initialized during installation of service
- region contains information of regions in the world follow
iso-639-2
- region is
read-only
resource
get /region
Query Parameters
- keyword: (string )
Example:
office
- pageIndex: (integer - minimum: 1 )
Example:
1
- pageSize: (integer - minimum: 1 )
Example:
16
HTTP status code 200
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"type": "object",
"minItems": 1,
"properties": {
"id": {
"type": "string",
"regex": "^[a-z]{2}$"
},
"name": {
"type": "string",
"regex": "^[a-Z0-9]{3, 32}$"
}
}
}
}
Example:
[
{"id": "en", "name": "english"},
{"id": "vi", "name": "vietnamese"}
]
HTTP status code 404
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "not found region"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "page index must be integer"
}
get /region/{id}
URI Parameters
- id: required (string - pattern: ^[a-z]{2}$)
Example:
en
HTTP status code 200
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string",
"regex": "^[a-z]{2}$"
},
"name": {
"type": "string",
"regex": "^[a-Z0-9]{3, 32}$"
}
}
}
Example:
{
"id": "en",
"name": "english"
}
HTTP status code 404
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "not found region"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "id must be two lowercase characters"
}
/scheduler
- scheduler contains meta data to initialize scheduler in client
- must login to create scheduler. user which identity will be own scheduler was created
- any body can
get
any scheduler - only owner can
put
,patch
,delete
scheduler
- must not specify
id
field. it will be generate by service - must not specify
author
. it will be fill by service after authenticate
get /scheduler
Query Parameters
- keyword: (string )
Example:
office
- pageIndex: (integer - minimum: 1 )
Example:
1
- pageSize: (integer - minimum: 1 )
Example:
16
HTTP status code 200
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array",
"items": {
"type": "object",
"minItems": 1,
"properties": {
"id": {
"type": "objectid"
},
"author": {
"type": "objectid"
},
"name": {
"type": "string",
"pattern": "^[a-zA-Z0-9 ]{2,16}$"
},
"tags": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9]{2,8}$"
}
},
"tasks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"start": {
"type": "string",
"pattern": "^[0-9]{1,2}:[0-9]{1,2}$"
},
"action": {
"type": "string",
"pattern": "^[a-z0-9 ]{1,16}$"
}
}
}
},
"notes": {
"type": "string",
"pattern": "^[a-zA-Z0-9 ]{0,1024}$"
}
}
}
}
Example:
[
{
"id": "57c80ebf0741aaca38f66ad0",
"author": "58c80ebf0741aaca38f66ad0",
"tags": ["office", "company", "hard"],
"tasks": [
{"start": "06:00", "action": "get up"},
{"start": "09:00", "action": "researching"},
{"start": "22:00", "action": "sleep"}
],
"notes": "work on company",
},
{
"id": "56c80ebf0741aaca38f66ad0",
"author": "55c80ebf0741aaca38f66ad0",
"tags": ["outside", "activities"],
"tasks": [
{"start": "06:00", "action": "get up"},
{"start": "09:00", "action": "football"},
{"start": "22:00", "action": "sleep"}
],
"notes": "outside activities",
}
]
HTTP status code 404
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "not found scheduler"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "page index must be integer"
}
post /scheduler
- must not specify
id
field. it will be generate by service - must not specify
author
. it will be fill by service after authenticate
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"name": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.]{2, 16}$"
},
"tags": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9]{2, 8}$"
}
},
"tasks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"start": {
"type": "string",
"pattern": "^[0-9]{1, 2}\\:[0-9]{1, 2}$"
},
"action": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.\\-]{1, 16}$"
}
}
}
},
"notes": {
"type": "string",
"pattern": "^[.]{0, 1024}$"
}
}
}
Example:
{
"tags": ["office", "company", "hard"],
"tasks": [
{"start": "06:00", "action": "get up"},
{"start": "09:00", "action": "researching"},
{"start": "22:00", "action": "sleep"}
],
"notes": "work on company",
}
HTTP status code 200
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "objectid"
},
"author": {
"type": "objectid"
},
"name": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.]{2, 16}$"
},
"tags": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9]{2, 8}$"
}
},
"tasks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"start": {
"type": "string",
"pattern": "^[0-9]{1, 2}\\:[0-9]{1, 2}$"
},
"action": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.\\-]{1, 16}$"
}
}
}
},
"notes": {
"type": "string",
"pattern": "^[.]{0, 1024}$"
}
}
}
Example:
{
"id": "57c80ebf0741aaca38f66ad0",
"author": "58c80ebf0741aaca38f66ad0",
"tags": ["office", "company", "hard"],
"tasks": [
{"start": "06:00", "action": "get up"},
{"start": "09:00", "action": "researching"},
{"start": "22:00", "action": "sleep"}
],
"notes": "work on company",
}
HTTP status code 400
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "can not parse body"
}
HTTP status code 401
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "must login to create scheduler"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "name must be characters a-z, 0-9, <space>"
}
- must not specify
id
- must not specify
author
- must not specify
id
- must not specify
author
get /scheduler/{id}
URI Parameters
- id: required (string - pattern: ^[a-z0-9]{24}$)
Example:
57c80ebf0741aaca38f66ad0
HTTP status code 200
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "objectid"
},
"author": {
"type": "objectid"
},
"name": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.]{2, 16}$"
},
"tags": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9]{2, 8}$"
}
},
"tasks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"start": {
"type": "string",
"pattern": "^[0-9]{1, 2}\\:[0-9]{1, 2}$"
},
"action": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.\\-]{1, 16}$"
}
}
}
},
"notes": {
"type": "string",
"pattern": "^[.]{0, 1024}$"
}
}
}
Example:
{
"id": "57c80ebf0741aaca38f66ad0",
"author": "58c80ebf0741aaca38f66ad0",
"tags": ["office", "company", "hard"],
"tasks": [
{"start": "06:00", "action": "get up"},
{"start": "09:00", "action": "researching"},
{"start": "22:00", "action": "sleep"}
],
"notes": "work on company",
}
HTTP status code 404
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "not found scheduler"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "id must be objectid"
}
put /scheduler/{id}
- must not specify
id
- must not specify
author
URI Parameters
- id: required (string - pattern: ^[a-z0-9]{24}$)
Example:
57c80ebf0741aaca38f66ad0
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"tags": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9]{2, 8}$"
}
},
"tasks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"start": {
"type": "string",
"pattern": "^[0-9]{1, 2}\\:[0-9]{1, 2}$"
},
"action": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.\\-]{1, 16}$"
}
}
}
},
"notes": {
"type": "string",
"pattern": "^[.]{0, 1024}$"
}
}
}
Example:
{
"tags": ["office", "company", "hard"],
"tasks": [
{"start": "06:00", "action": "get up"},
{"start": "09:00", "action": "researching"},
{"start": "22:00", "action": "sleep"}
],
"notes": "work on company",
}
HTTP status code 200
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "objectid"
},
"author": {
"type": "objectid"
},
"name": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.]{2, 16}$"
},
"tags": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9]{2, 8}$"
}
},
"tasks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"start": {
"type": "string",
"pattern": "^[0-9]{1, 2}\\:[0-9]{1, 2}$"
},
"action": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.\\-]{1, 16}$"
}
}
}
},
"notes": {
"type": "string",
"pattern": "^[.]{0, 1024}$"
}
}
}
Example:
{
"id": "57c80ebf0741aaca38f66ad0",
"author": "58c80ebf0741aaca38f66ad0",
"tags": ["office", "company", "hard"],
"tasks": [
{"start": "06:00", "action": "get up"},
{"start": "09:00", "action": "researching"},
{"start": "22:00", "action": "sleep"}
],
"notes": "work on company",
}
HTTP status code 400
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "can not parse body"
}
HTTP status code 401
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "must login to update scheduler"
}
HTTP status code 403
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "can not update scheduler of other user"
}
HTTP status code 404
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "not found scheduler"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "name must be characters a-z, 0-9, <space>"
}
patch /scheduler/{id}
- must not specify
id
- must not specify
author
URI Parameters
- id: required (string - pattern: ^[a-z0-9]{24}$)
Example:
57c80ebf0741aaca38f66ad0
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"tags": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9]{2, 8}$"
}
},
"tasks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"start": {
"type": "string",
"pattern": "^[0-9]{1, 2}\\:[0-9]{1, 2}$"
},
"action": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.\\-]{1, 16}$"
}
}
}
},
"notes": {
"type": "string",
"pattern": "^[.]{0, 1024}$"
}
}
}
Example:
{
"tags": ["office", "company", "hard"],
"tasks": [
{"start": "06:00", "action": "get up"},
{"start": "09:00", "action": "researching"},
{"start": "22:00", "action": "sleep"}
],
"notes": "work on company",
}
HTTP status code 200
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "objectid"
},
"author": {
"type": "objectid"
},
"name": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.]{2, 16}$"
},
"tags": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9]{2, 8}$"
}
},
"tasks": {
"type": "array",
"items": {
"type": "object",
"properties": {
"start": {
"type": "string",
"pattern": "^[0-9]{1, 2}\\:[0-9]{1, 2}$"
},
"action": {
"type": "string",
"pattern": "^[a-Z0-9\\s\\.\\-]{1, 16}$"
}
}
}
},
"notes": {
"type": "string",
"pattern": "^[.]{0, 1024}$"
}
}
}
Example:
{
"id": "57c80ebf0741aaca38f66ad0",
"author": "58c80ebf0741aaca38f66ad0",
"tags": ["office", "company", "hard"],
"tasks": [
{"start": "06:00", "action": "get up"},
{"start": "09:00", "action": "researching"},
{"start": "22:00", "action": "sleep"}
],
"notes": "work on company",
}
HTTP status code 400
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "can not parse body"
}
HTTP status code 401
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "must login to update scheduler"
}
HTTP status code 403
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "can not update scheduler of other user"
}
HTTP status code 404
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "not found scheduler"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "name must be characters a-z, 0-9, <space>"
}
delete /scheduler/{id}
URI Parameters
- id: required (string - pattern: ^[a-z0-9]{24}$)
Example:
57c80ebf0741aaca38f66ad0
HTTP status code 204
HTTP status code 401
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "must login to remove scheduler"
}
HTTP status code 403
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "can not remove scheduler of other user"
}
HTTP status code 404
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "not found scheduler"
}
HTTP status code 422
Body
Type: application/json
Schema:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string",
"regex": "^[a-zA-Z0-9 ]{0,128}$"
}
}
}
Example:
{
"message": "id must be objectid"
}