Air travel
Retrieve all AirTravelSegment that belong to a company
limit of records per page
10
page number
2
This field is used to filter by air-travel name. (LIKE)
test name
This field is used to filter by air-travel currency.
USD
This parameter is used to sort the records by a specific field (created_at,traveler_name)
traveler_name
Order type(asc or desc)
asc
Successful operation
Bad Request
Unauthenticated
Not Found
Internal Server
GET /api/air-travel HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
"status": "Ok",
"message": "Success",
"data": [
{
"id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
"traveler_name": "test name",
"traveler_email": "[email protected]",
"spend_amount": "2000.32",
"distance_mi": "9164",
"distance_km": "14745",
"currency": "USD",
"segments": [
{
"id": "99b80a01-fd16-4c8a-9716-db37407bdc67",
"departure": {
"id": "36616115-61ba-4890-a6ce-ddb4e4e68ec4",
"iata_code": "ATD",
"icao_code": "AGAT",
"airport_name": "Atoifi"
},
"arrival": {
"id": "300a8ec20-ad3b-4377-a003-0baa23deae3e",
"iata_code": "ERM",
"icao_code": "SSER",
"airport_name": "Comandante Kraemer"
},
"started_at": "2023-06-12 17:30:21",
"ended_at": "2023-06-12 17:30:21",
"flight_date": "2023-06-12",
"flight_status": "Completed",
"flight_number": "A121312",
"distance_mi": "9164",
"distance_km": "14745",
"airline": {
"id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
"iata_code": "7P",
"icao_code": "PST",
"airline_name": "Air Panama dba Parsa, S.A."
},
"emission": {
"scope": "3",
"carbon_equivalent": "6573.6700",
"carbon_dioxide": "2641.0894",
"methane": "0.1460",
"nitrous_oxide": "13.1397"
}
}
]
}
],
"meta": {
"pagination": {
"current": "1",
"last_page": "1",
"per_page": "10",
"total": "6"
}
}
}
Store an AirTravel for a particular compny.
create AirTravel request body data
name of the air-travel
test name
spend_amount of the air-travel
2000.32
currency of the air-travel, by default is USD
USD
Successful operation
Bad Request
Unauthenticated
Not Found
Internal Server
POST /api/air-travel HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 393
{
"traveler_name": "test name",
"traveler_email": "[email protected]",
"spend_amount": "2000.32",
"currency": "USD",
"segments": [
{
"airline_id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
"flight_date": "2023-03-17",
"flight_number": "A1212",
"flight_status": "completed",
"departure_id": "AGAT",
"arrival_id": "730fcf91-1d3c-44e7-b4ef-7c9dbb7d8aee",
"started_at": "2023-03-17 12:34:56",
"ended_at": "2023-03-17 13:45:30"
}
]
}
{
"status": "Ok",
"message": "Success",
"data": {
"id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
"traveler_name": "test name",
"traveler_email": "[email protected]",
"spend_amount": "2000.32",
"distance_mi": "9164",
"distance_km": "14745",
"currency": "USD",
"segments": [
{
"id": "99b80a01-fd16-4c8a-9716-db37407bdc67",
"departure": {
"id": "36616115-61ba-4890-a6ce-ddb4e4e68ec4",
"iata_code": "ATD",
"icao_code": "AGAT",
"airport_name": "Atoifi"
},
"arrival": {
"id": "300a8ec20-ad3b-4377-a003-0baa23deae3e",
"iata_code": "ERM",
"icao_code": "SSER",
"airport_name": "Comandante Kraemer"
},
"started_at": "2023-06-12 17:30:21",
"ended_at": "2023-06-12 17:30:21",
"flight_date": "2023-06-12",
"flight_status": "Completed",
"flight_number": "A121312",
"distance_mi": "9164",
"distance_km": "14745",
"airline": {
"id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
"iata_code": "7P",
"icao_code": "PST",
"airline_name": "Air Panama dba Parsa, S.A."
},
"emission": {
"scope": "3",
"carbon_equivalent": "6573.6700",
"carbon_dioxide": "2641.0894",
"methane": "0.1460",
"nitrous_oxide": "13.1397"
}
}
]
},
"meta": {}
}
obtain information about a air-travel
ID of The AirTravel
996501df-0bfc-4f95-954d-3a5d5dc48469
Successful operation
Bad Request
Unauthenticated
Not Found
Internal Server
GET /api/air-travel/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
"status": "Ok",
"message": "Success",
"data": {
"id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
"traveler_name": "test name",
"traveler_email": "[email protected]",
"spend_amount": "2000.32",
"distance_mi": "9164",
"distance_km": "14745",
"currency": "USD",
"segments": [
{
"id": "99b80a01-fd16-4c8a-9716-db37407bdc67",
"departure": {
"id": "36616115-61ba-4890-a6ce-ddb4e4e68ec4",
"iata_code": "ATD",
"icao_code": "AGAT",
"airport_name": "Atoifi"
},
"arrival": {
"id": "300a8ec20-ad3b-4377-a003-0baa23deae3e",
"iata_code": "ERM",
"icao_code": "SSER",
"airport_name": "Comandante Kraemer"
},
"started_at": "2023-06-12 17:30:21",
"ended_at": "2023-06-12 17:30:21",
"flight_date": "2023-06-12",
"flight_status": "Completed",
"flight_number": "A121312",
"distance_mi": "9164",
"distance_km": "14745",
"airline": {
"id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
"iata_code": "7P",
"icao_code": "PST",
"airline_name": "Air Panama dba Parsa, S.A."
},
"emission": {
"scope": "3",
"carbon_equivalent": "6573.6700",
"carbon_dioxide": "2641.0894",
"methane": "0.1460",
"nitrous_oxide": "13.1397"
}
}
]
},
"meta": {}
}
Update an AirTravel for a company
ID of The AirTravel
996501df-0bfc-4f95-954d-3a5d5dc48469
update AirTravel request body data
name of the air-travel
test name
spend_amount of the air-travel
2000.32
currency of the air-travel, by default is USD
USD
Successful operation
Bad Request
Unauthenticated
Not Found
Internal Server
PUT /api/air-travel/{id} HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 393
{
"traveler_name": "test name",
"traveler_email": "[email protected]",
"spend_amount": "2000.32",
"currency": "USD",
"segments": [
{
"airline_id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
"flight_date": "2023-03-17",
"flight_number": "A1212",
"flight_status": "completed",
"departure_id": "AGAT",
"arrival_id": "730fcf91-1d3c-44e7-b4ef-7c9dbb7d8aee",
"started_at": "2023-03-17 12:34:56",
"ended_at": "2023-03-17 13:45:30"
}
]
}
{
"status": "Ok",
"message": "Success",
"data": {
"id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
"traveler_name": "test name",
"traveler_email": "[email protected]",
"spend_amount": "2000.32",
"distance_mi": "9164",
"distance_km": "14745",
"currency": "USD",
"segments": [
{
"id": "99b80a01-fd16-4c8a-9716-db37407bdc67",
"departure": {
"id": "36616115-61ba-4890-a6ce-ddb4e4e68ec4",
"iata_code": "ATD",
"icao_code": "AGAT",
"airport_name": "Atoifi"
},
"arrival": {
"id": "300a8ec20-ad3b-4377-a003-0baa23deae3e",
"iata_code": "ERM",
"icao_code": "SSER",
"airport_name": "Comandante Kraemer"
},
"started_at": "2023-06-12 17:30:21",
"ended_at": "2023-06-12 17:30:21",
"flight_date": "2023-06-12",
"flight_status": "Completed",
"flight_number": "A121312",
"distance_mi": "9164",
"distance_km": "14745",
"airline": {
"id": "000f13cd-d397-44cb-948b-edace9f8b4dc",
"iata_code": "7P",
"icao_code": "PST",
"airline_name": "Air Panama dba Parsa, S.A."
},
"emission": {
"scope": "3",
"carbon_equivalent": "6573.6700",
"carbon_dioxide": "2641.0894",
"methane": "0.1460",
"nitrous_oxide": "13.1397"
}
}
]
},
"meta": {}
}
remove air-travel
ID of The AirTravel
996501df-0bfc-4f95-954d-3a5d5dc48469
Successful operation
Bad Request
Unauthenticated
Not Found
Internal Server
DELETE /api/air-travel/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
"status": "Ok",
"message": "Success",
"data": null,
"meta": {}
}
Last updated