Documentation of the API
This commit is contained in:
parent
2dc98efbd0
commit
e30831da41
65
README.md
Normal file
65
README.md
Normal file
|
@ -0,0 +1,65 @@
|
|||
Automate Android API
|
||||
====================
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
$ git clone https://gitnet.fr/deblan/android-automate-api.git
|
||||
$ cd android-automate-api
|
||||
$ make
|
||||
$ cp propel-dist.yaml propel.yaml # Edit propel.yaml
|
||||
$ make propel
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### HTTP Response status
|
||||
|
||||
* `200`: Resource found
|
||||
* `201`: Resource created
|
||||
* `204`: Resource removed
|
||||
* `404`: Resource not found
|
||||
* `500`: Internal error
|
||||
|
||||
When a resource is created or deleted, the response will be like:
|
||||
|
||||
```
|
||||
{
|
||||
"status": true|false,
|
||||
"code": 200|201|204|404|500,
|
||||
"message": "A message"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
#### Create a SMS
|
||||
|
||||
`POST /api/sms/create` with MIME media type `application/json`
|
||||
|
||||
*Body*
|
||||
```
|
||||
{"sender": "+33611223344", "message": "Hello, World!", "time": "1516031177"}
|
||||
```
|
||||
|
||||
#### Delete a SMS
|
||||
|
||||
`DELETE /api/sms/delete/{id}`
|
||||
|
||||
#### Get all SMS
|
||||
|
||||
`GET /api/sms/list`
|
||||
|
||||
The response contains an collection of SMS:
|
||||
|
||||
```
|
||||
[
|
||||
{
|
||||
"id": 1234,
|
||||
"sender": "+33611223344",
|
||||
"message": "Hello, World!",
|
||||
"received_at": 1516031177,
|
||||
"notified_at": 1516031179
|
||||
},
|
||||
...
|
||||
]
|
||||
```
|
Loading…
Reference in a new issue