This repository has been archived by the owner on Feb 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
API methods
Carlos Lucas edited this page Mar 17, 2018
·
11 revisions
All responses are JSON and uses the same format. The only thing that changes is the type of the object in the field results.
Field | Type | Description |
---|---|---|
count | integer | Number of objects found for this query in this page |
next | string | URL to the next page of the query results |
previous | string | URL to the previous page of the query results |
results | list of objects | List containing all the objects found for the query |
{
"count": 2,
"next": null,
"previous": null,
"results": [
{ ... },
{ ... }
]
}
GET /entities
Content-Type: application/json
None
Field | Type | Description |
---|---|---|
id | integer | Unique identifier for the entity |
name | string | Name of the entity |
string | Contact email for this entity | |
location | string | Adress where you can find this entity |
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"email": "aragonia@gmail.com",
"name": "Aragonia",
"location": "Palma"
}
]
}
GET /animals
Content-Type: application/json
Name | Value | Description |
---|---|---|
entity | any entity id | It returns animals of that entity |
size | S, M or B (small, medium, big) | It returns animals of that size |
sex | M for male or F for female | It returns animals of that sex |
breed | any breed id | It returns animals of that breed |
is_castrated | boolean | It returns castrated animals |
has_chip | boolean | It returns animals that has the chip |
Field | Type | Description |
---|---|---|
id | integer | Unique identifier of the animal |
name | string | Name of the animal |
breed | integer | Id of the breed of the animal |
sex | string | M for male, F for female |
size | string | --- |
weight | string | Current weight of the animal in kilograms |
registration | string | Date and time in ISO format when the animal has been added to our system |
entity | integer | Id of the entity responsible of this animal |
pic | string | URL to a picture of the animal |
bio | string | Description of the animal |
medical_record | object | Object containing medical information of the animal |
medical_record/vaccines | string | Free text explaining the vaccines the animal has |
medical_record/castrated | boolean | True only if the animal is castrated |
medical_record/chip | boolean | True only if the animal has the chip |
medical_record/comments | string | Description for other medical information |
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"breed": 3,
"medical_record": {
"vaccines": "rabia, gonorrea",
"castrated": true,
"chip": false,
"comments": ""
},
"name": "Bobby",
"weight": "15.00",
"size": "M",
"sex": "M",
"registration": "2018-03-17T18:35:11.126486+01:00",
"pic": null,
"bio": "",
"entity": 1
}
]
}
GET /species
Content-Type: application/json
None
Field | Type | Description |
---|---|---|
id | integer | Unique identifier for the species |
name | string | Name of the species |
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"name": "dog"
}
]
}
GET /breeds
Content-Type: application/json
Name | Value | Description |
---|---|---|
name | any string | Filters using the name of the breed |
species | any species id | Filters using the specified species id |
Field | Type | Description |
---|---|---|
id | integer | Unique identifier for the breed |
name | string | Name of the breed |
species | integer | Unique id of its corresponding species |
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 3,
"species": 2,
"name": "husky"
}
]
}