GreenPlaces Integrations
HomeDashboard
  • 👋Welcome to GreenPlaces
  • Overview
    • Adding your Team
    • Available Integrations
      • 👥HRIS
      • ⚡Utilities
      • 📖Accounting
    • Configuring SSO
  • Integrations
    • HRIS
    • Accounting
    • Utilities
  • GreenPlaces API
    • 🌏API Overview
    • 🔐Authentication
    • 🧭API Reference
      • Air travel
        • Bulk
        • Segments
      • Appliances
        • File
      • Expenses
      • Locations
      • Vehicles
      • Vendors
    • Specification
  • Page
Powered by GitBook
On this page
  1. GreenPlaces API
  2. API Reference
  3. Air travel

Segments

PreviousBulkNextAppliances
🧭

Retrieve an AirTravelSegment

get

Retrieve an AirTravelSegment that belongs to a particular AirTravel

Path parameters
air_travel_idstringRequired

ID of the AirTravel

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
idstringRequired

ID of the AirTravelSegment

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Responses
200
Successful operation
application/json
400
Bad Request
application/json
403
Unauthenticated
application/json
404
Not Found
application/json
500
Internal Server
application/json
get
GET /api/air-travel/{air_travel_id}/segments/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "airline_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "flight_date": "2023-06-12T17:30:21.000000Z",
    "flight_number": "BA2490",
    "flight_status": "completed",
    "started_at": "2023-06-12T17:30:21.000000Z",
    "ended_at": "2023-06-12T17:30:21.000000Z",
    "aircraft": {},
    "departure_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "arrival_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "distance_mi": "12.2",
    "distance_km": "45.2",
    "emission": null,
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}

Delete an AirTravelSegment

delete

Delete an AirTravelSegment that belongs to a specific AirTravel

Path parameters
air_travel_idstringRequired

ID of the AirTravel

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
idstringRequired

ID of the AirTravelSegment

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Responses
200
Successful operation
application/json
400
Bad Request
application/json
403
Unauthenticated
application/json
404
Not Found
application/json
500
Internal Server
application/json
delete
DELETE /api/air-travel/{air_travel_id}/segments/{id} HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": null,
  "meta": {}
}
  • GETRetrieve all AirTravelSegment
  • POSTStore an AirTravelSegment
  • GETRetrieve an AirTravelSegment
  • PUTUpdate an AirTravelSegment
  • DELETEDelete an AirTravelSegment

Retrieve all AirTravelSegment

get

Retreive all AirTravelSegment that belong to a specific AirTravel

Path parameters
air_travel_idstringRequired

ID of the AirTravel

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Query parameters
per_pageintegerOptional

limit of records per page

Example: 10
pageintegerOptional

page number

Example: 2
sort_bystringOptional

This parameter is used to sort the records by a specific field (flight_date,flight_number,flight_status,started_at,ended_at,created_at)

Example: type
sort_dirstringOptional

Order type(asc or desc)

Example: asc
Responses
200
Successful operation
application/json
400
Bad Request
application/json
403
Unauthenticated
application/json
404
Not Found
application/json
500
Internal Server
application/json
get
GET /api/air-travel/{air_travel_id}/segments HTTP/1.1
Host: app.greenplaces.com
Accept: */*
{
  "status": "Ok",
  "message": "Success",
  "data": [
    {
      "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
      "airline_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
      "flight_date": "2023-06-12T17:30:21.000000Z",
      "flight_number": "BA2490",
      "flight_status": "completed",
      "started_at": "2023-06-12T17:30:21.000000Z",
      "ended_at": "2023-06-12T17:30:21.000000Z",
      "aircraft": {},
      "departure_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
      "arrival_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
      "distance_mi": "12.2",
      "distance_km": "45.2",
      "emission": null,
      "updated_at": "2023-06-12T17:30:21.000000Z",
      "created_at": "2023-06-12T17:30:21.000000Z"
    }
  ],
  "meta": {
    "pagination": {
      "current": "1",
      "last_page": "1",
      "per_page": "10",
      "total": "6"
    }
  }
}

Store an AirTravelSegment

post

Store an AirTravelSegment to a particular AirTravel

Path parameters
air_travel_idstringRequired

ID of the AirTravel

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Body

Creates airtravel segment request body data

airline_idanyRequired

Airline ID for the airtravel segment

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
flight_dateanyRequired

Flight Date for the airtravel segment

Example: 2023-03-17
flight_numberanyOptional

Flight Number for the airtravel segment

Example: BA2490
flight_statusanyOptional

Flight Status for the airtravel segment

Example: completed
started_atanyOptional

Started At for the airtravel segment

Example: 2023-03-17 12:34:56
ended_atanyOptional

Ended At for the airtravel segment

Example: 2023-03-17 13:45:30
aircraftanyOptional

Aircraft for the airtravel segment

Example: {}
departure_idanyRequired

Departure ID for the airtravel segment

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
arrival_idanyRequired

Arrival ID for the airtravel segment

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Responses
200
Successful operation
application/json
400
Bad Request
application/json
403
Unauthenticated
application/json
404
Not Found
application/json
500
Internal Server
application/json
post
POST /api/air-travel/{air_travel_id}/segments HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 323

{
  "airline_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
  "flight_date": "2023-03-17",
  "flight_number": "BA2490",
  "flight_status": "completed",
  "started_at": "2023-03-17 12:34:56",
  "ended_at": "2023-03-17 13:45:30",
  "aircraft": "{}",
  "departure_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
  "arrival_id": "996501df-0bfc-4f95-954d-3a5d5dc48469"
}
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "airline_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "flight_date": "2023-06-12T17:30:21.000000Z",
    "flight_number": "BA2490",
    "flight_status": "completed",
    "started_at": "2023-06-12T17:30:21.000000Z",
    "ended_at": "2023-06-12T17:30:21.000000Z",
    "aircraft": {},
    "departure_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "arrival_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "distance_mi": "12.2",
    "distance_km": "45.2",
    "emission": null,
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}

Update an AirTravelSegment

put

Update an AirTravelSegment for a particular AirTravel

Path parameters
air_travel_idstringRequired

ID of the AirTravel

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
idstringRequired

ID of the AirTravelSegment

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Body

Update airtravel segment request body data

airline_idanyRequired

Airline ID for the airtravel segment

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
flight_dateanyRequired

Flight Date for the airtravel segment

Example: 2023-06-12T17:30:21.000000Z
flight_numberanyOptional

Flight Number for the airtravel segment

Example: BA2490
flight_statusanyOptional

Flight Status for the airtravel segment

Example: completed
started_atanyOptional

Started At for the airtravel segment

Example: 2023-06-12T17:30:21.000000Z
ended_atanyOptional

Ended At for the airtravel segment

Example: 2023-06-12T17:30:21.000000Z
aircraftanyOptional

Aircraft for the airtravel segment

Example: {}
departure_idanyRequired

Departure ID for the airtravel segment

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
arrival_idanyRequired

Arrival ID for the airtravel segment

Example: 996501df-0bfc-4f95-954d-3a5d5dc48469
Responses
200
Successful operation
application/json
400
Bad Request
application/json
403
Unauthenticated
application/json
404
Not Found
application/json
500
Internal Server
application/json
put
PUT /api/air-travel/{air_travel_id}/segments/{id} HTTP/1.1
Host: app.greenplaces.com
Content-Type: application/json
Accept: */*
Content-Length: 356

{
  "airline_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
  "flight_date": "2023-06-12T17:30:21.000000Z",
  "flight_number": "BA2490",
  "flight_status": "completed",
  "started_at": "2023-06-12T17:30:21.000000Z",
  "ended_at": "2023-06-12T17:30:21.000000Z",
  "aircraft": "{}",
  "departure_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
  "arrival_id": "996501df-0bfc-4f95-954d-3a5d5dc48469"
}
{
  "status": "Ok",
  "message": "Success",
  "data": {
    "id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "airline_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "flight_date": "2023-06-12T17:30:21.000000Z",
    "flight_number": "BA2490",
    "flight_status": "completed",
    "started_at": "2023-06-12T17:30:21.000000Z",
    "ended_at": "2023-06-12T17:30:21.000000Z",
    "aircraft": {},
    "departure_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "arrival_id": "996501df-0bfc-4f95-954d-3a5d5dc48469",
    "distance_mi": "12.2",
    "distance_km": "45.2",
    "emission": null,
    "updated_at": "2023-06-12T17:30:21.000000Z",
    "created_at": "2023-06-12T17:30:21.000000Z"
  },
  "meta": {}
}