-
Notifications
You must be signed in to change notification settings - Fork 1
api‐specification ‐ status
Dingensen edited this page Jan 20, 2020
·
2 revisions
specification formatting based on idratherbewriting.com/learnapidoc/docapis_resource_descriptions.html
specification of the API that internally handles messages of currently running processes and error statuses.
- The API to handle status indicator communication
/status:
| method | path |
|---|---|
| GET | /status/currentprocesses |
| POST | /status/newprocess |
-
Retreive information about current running processes on the server side
Parameters-
older_thanstring, UNIX-timestamp indicating the maximum age of the processes -
removeboolean, if false indicated processes won't be cleared after call
-
-
Allows a server component to tell the API what it is currently doing Parameters
| Name | Method | Description |
|---|---|---|
statuses/currentprocesses |
GET | Get the list of processes that are currently in progress, according to the status-API |
| Name | Data Type | Required / Optional | Description |
|---|---|---|---|
| older_than | number | optional | UNIX-timestamp (in milliseconds) minimum allowed age of the messages |
| remove | Boolean | optional | Whether or not to remove all statuses from the API after they were called. Defaults to TRUE if not used. |
| Name | Method | Description |
|---|---|---|
statuses/newprocess |
POST | Post a status indicator message to the Status API |
Requires the body to be composed in x-www-form-urlencoded!
| Name | Data Type | Required / Optional | Description |
|---|---|---|---|
| created_at | number | required | UNIX-timestamp (in milliseconds) of the time the message was posted |
| message | String | required | The String containing the message part of the message. this will be displayed on site in the progress-indicator |
localhost:3000/status/currentprocesses?remove=true&older_than=0
[
{
"_id": "5e11adf3af423d42300e8519",
"created_at": 1578215915,
"message": "this is a message",
"__v": 0
}
]curl --location --request POST 'localhost:3000/status/newprocess' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'created_at=1578215915' \
--data-urlencode 'message=this is a message'
Status successfully posted