A parking compay manages a set of parking spots.
Retrieves all the parking companies.
-
Resource URI: /companies
-
HTTP Req type: GET
-
Res Content Type: application/json
HTTP Res Code |
Structure |
Description |
200 OK |
|
Returns the list of parking companies |
404 Not found |
|
The resource cannot be found |
GET /companies
{
"code": "200",
"status": "success",
"message": "Resource successfully retrieved",
"content": [
{
"address": {
"street": "Via Aldo Moro 11",
"city": "Camerino",
"postalCode": 62032
},
"telephone": 3934677657,
"_id": "5dfcaf510d38bcfb60739b69",
"name": "Company1",
"partitaIVA": "02011346424",
"email": "[email protected]"
},
{
"address": {
"street": "Via Aldo Moro 12",
"city": "Camerino",
"postalCode": 62032
},
"telephone": 3935577657,
"_id": "5e2033e82681366ecc7cb75e",
"name": "Company2",
"email": "[email protected]",
"partitaIVA": "99913090424"
}
]
}
Retrieves a specific parking company.
-
Resource URI: /companies/:name
-
HTTP Req type: GET
-
Res Content Type: application/json
Parameter |
Type |
Description |
name |
String |
Name of the parking company |
HTTP Res Code |
Structure |
Description |
200 OK |
|
Returns the requested parking company |
404 Not found |
|
The resource cannot be found |
GET /companies/Company1
{
"code": "200",
"status": "success",
"message": "Resource successfully retrieved",
"content": [
{
"address": {
"street": "Via Aldo Moro 11",
"city": "Camerino",
"postalCode": 62032
},
"telephone": 3934677657,
"_id": "5dfcaf510d38bcfb60739b69",
"name": "Company1",
"partitaIVA": "02011346424",
"email": "[email protected]"
}
]
}
Registers a new parking company.
-
Resource URI: /companies
-
HTTP Req type: POST
-
Req Content Type: application/x-www-form-urlencoded
-
Res Content Type: application/json
Parameter |
Type |
Description |
name |
String |
Parking company name |
email |
String |
Parking company email |
telephone |
String |
Parking company phone number |
partitaIVA |
String |
Parking company P. IVA |
city |
String |
Parking company city |
street |
String |
Parking company address |
postalCode |
String |
Parking company postal code |
HTTP Res Code |
Structure |
Description |
201 Created |
|
Resource has been successfully created |
422 Unprocessable Entity |
|
Resource already exists |
401 Unauthorized |
|
Invalid or missing authorization token |
POST /companies
{
"code": "201",
"status": "success",
"message": "Resource successfully created",
"content": {
"address": {
"street": "Via Le Mosse, 75",
"city": "Camerino",
"postalCode": 62032
},
"telephone": 73745379,
"_id": "5e56a20b1ddc391118992071",
"name": "Company4",
"email": "[email protected]",
"partitaIVA": "99913090424"
}
}
Deletes a parking company.
-
Resource URI: /companies/:name/parkings/:id
-
HTTP Req type: DELETE
-
Res Content Type: application/json
Parameter |
Type |
Description |
name |
String |
Name of the parking company |
HTTP Res Code |
Structure |
Description |
204 No Content |
|
Resource has been successfully deleted |
404 Not found |
|
The resource cannot be found |
401 Unauthorized |
|
Invalid or missing authorization token |