Introduction

Overview

This is an OData version 4.0 standard compliant REST API that exposes entities and their relationships using well defined access, navigation and modification rules.

*Please note that XOData has generated this document by interpreting just the metadata document ( /$metadata ) provided by this API according to OData specification. API Developer should review the generated information. Further, text descriptions can be super-imposed by a technical writer to complete the API documentation. XOData API Log can be used to prepare request/response details for Methods & Examples section.

**Auto-save is provided for edits using local storage(limited memory). Please download the document after manual additions.

Version

API Name
Microsoft.OData.SampleService.Models.TripPin
API Version
OData Protocol Version
4.0

Authentication

Access

Following API endpoint and resources are exposed to be accessible with appropriate authorization.

Service Level Documents

Top Level Resources

Indirectly Accessible Resources

PlanItem
Accessible through parent Resource i.e. Trip
PublicTransportation
Accessible through parent of base type Resource i.e. PlanItem
Flight
Accessible through parent of base type Resource i.e. PublicTransportation
Event
Accessible through parent of base type Resource i.e. PlanItem
Trip
Accessible through parent Resource i.e. Person

Error Codes

Standard HTTP status codes are used for HTTP communication level error information. Further, OData Protocol level and application level error information is provided in the message-body. Application level error information is provided with a well defined structure. An example error response in JSON format is as below:

Sample Error Response

HTTP/1.1 404 Not Found
{
  "error": {
    "code": "NotFound",
    "message": "Resource not found for the segment 'Wrong Resource Name'.",
    "innererror": {
      "message": "Further application level details on error.",
      "type": "Type of Error Text"
    }
  }
}

About OData

OData : Open Data Protocol is a standard to enable the development and consumption of consistent and functionally effective Web APIs. Since OData is a standard, it also enables the ecosystem of compliant frameworks, generic tools and applications that help people from diverse skill-set, technical as well as business/domain background to get involved with API/Application development and consumption. For a REST API Standard, OData (V1 to V3) was well received by the enterprise business application software industry and OData V4 is now an ISO and OASIS standard as well. 

For further details, please refer to: 

Additionally, PragmatiQa's OData Directory has a growing list of publicly accessible Reference/Demo/Sample OData Services & APIs that can be explored using integrated XOData or through other generic OData tools with support for corresponding version of OData.

Entities

Photo

Photo Properties

nametypeDescriptionnullable
Id ๐Ÿ”‘Edm.Int64false
NameEdm.String

Photo Representation

{
  "@odata.type": "Microsoft.OData.SampleService.Models.TripPin.Photo",
  "Id": "",
  "Name": ""
}

Photo Methods & Examples


GET
http://services.odata.org/V4/(S(jndgbgy2tbu1vjtzyoei2w3e))/TripPinServiceRW/Photos

Request

Content-type: application/json

Response

Person

Person Properties

nametypeDescriptionnullable
UserName ๐Ÿ”‘Edm.Stringfalse
FirstNameEdm.Stringfalse
LastNameEdm.Stringfalse
EmailsCollection(Edm.String)
AddressInfoCollection(Microsoft.OData.SampleService.Models.TripPin.Location)
GenderMicrosoft.OData.SampleService.Models.TripPin.PersonGender
ConcurrencyEdm.Int64false

Person Relations

nameEntity TypeDescriptionextensionsTypecontainsTarget
FriendsPersonCollection(Microsoft.OData.SampleService.Models.TripPin.Person)
TripsTripCollection(Microsoft.OData.SampleService.Models.TripPin.Trip)true
PhotoPhotoMicrosoft.OData.SampleService.Models.TripPin.Photo

Person Representation

{
  "@odata.type": "Microsoft.OData.SampleService.Models.TripPin.Person",
  "UserName": "",
  "FirstName": "",
  "LastName": "",
  "Emails": [
    ""
  ],
  "AddressInfo": [
    {
      "Address": "",
      "City": {
        "CountryRegion": "",
        "Name": "",
        "Region": ""
      }
    }
  ],
  "Gender": "Male",
  "Concurrency": ""
}

Person Methods & Examples


GET
http://services.odata.org/V4/(S(jndgbgy2tbu1vjtzyoei2w3e))/TripPinServiceRW/People

Request

Content-type: application/json

Response

Airline

Airline Properties

nametypeDescriptionnullable
AirlineCode ๐Ÿ”‘Edm.Stringfalse
NameEdm.Stringfalse

Airline Representation

{
  "@odata.type": "Microsoft.OData.SampleService.Models.TripPin.Airline",
  "AirlineCode": "",
  "Name": ""
}

Airline Methods & Examples


GET
http://services.odata.org/V4/(S(jndgbgy2tbu1vjtzyoei2w3e))/TripPinServiceRW/Airlines

Request

Content-type: application/json

Response

Airport

Airport Properties

nametypeDescriptionnullable
IcaoCode ๐Ÿ”‘Edm.Stringfalse
NameEdm.Stringfalse
IataCodeEdm.Stringfalse
LocationMicrosoft.OData.SampleService.Models.TripPin.AirportLocationfalse

Airport Representation

{
  "@odata.type": "Microsoft.OData.SampleService.Models.TripPin.Airport",
  "IcaoCode": "",
  "Name": "",
  "IataCode": "",
  "Location": {
    "Loc": "",
    "Address": "",
    "City": {
      "CountryRegion": "",
      "Name": "",
      "Region": ""
    }
  }
}

Airport Methods & Examples


GET
http://services.odata.org/V4/(S(jndgbgy2tbu1vjtzyoei2w3e))/TripPinServiceRW/Airports

Request

Content-type: application/json

Response

PlanItem

PlanItem Properties

nametypeDescriptionnullable
PlanItemId ๐Ÿ”‘Edm.Int32false
ConfirmationCodeEdm.String
StartsAtEdm.DateTimeOffset
EndsAtEdm.DateTimeOffset
DurationEdm.Duration

PlanItem Representation

{
  "@odata.type": "Microsoft.OData.SampleService.Models.TripPin.PlanItem",
  "PlanItemId": 0,
  "ConfirmationCode": "",
  "StartsAt": "2016-07-25T11:45:16Z",
  "EndsAt": "2016-07-25T11:45:16Z",
  "Duration": ""
}

PlanItem Methods & Examples


GET
http://services.odata.org/V4/(S(jndgbgy2tbu1vjtzyoei2w3e))/TripPinServiceRW/<SPECIFY_PARENT_RESOURCE(KEY)>/PlanItem

Request

Content-type: application/json

Response

PublicTransportation

PublicTransportation Properties

nametypeDescription
SeatNumberEdm.String

PublicTransportation Representation

{
  "@odata.type": "Microsoft.OData.SampleService.Models.TripPin.PublicTransportation",
  "SeatNumber": "",
  "PlanItemId": 0,
  "ConfirmationCode": "",
  "StartsAt": "2016-07-25T11:45:16Z",
  "EndsAt": "2016-07-25T11:45:16Z",
  "Duration": ""
}

PublicTransportation Methods & Examples


GET
http://services.odata.org/V4/(S(jndgbgy2tbu1vjtzyoei2w3e))/TripPinServiceRW/<SPECIFY_PARENT_RESOURCE(KEY)>/Microsoft.OData.SampleService.Models.TripPin.PublicTransportation

Request

Content-type: application/json

Response

Flight

Flight Properties

nametypeDescriptionnullable
FlightNumberEdm.Stringfalse

Flight Relations

nameEntity TypeDescriptionextensionsTypeNullable
FromAirportMicrosoft.OData.SampleService.Models.TripPin.Airportfalse
ToAirportMicrosoft.OData.SampleService.Models.TripPin.Airportfalse
AirlineAirlineMicrosoft.OData.SampleService.Models.TripPin.Airlinefalse

Flight Representation

{
  "@odata.type": "Microsoft.OData.SampleService.Models.TripPin.Flight",
  "FlightNumber": "",
  "SeatNumber": "",
  "PlanItemId": 0,
  "ConfirmationCode": "",
  "StartsAt": "2016-07-25T11:45:16Z",
  "EndsAt": "2016-07-25T11:45:16Z",
  "Duration": ""
}

Flight Methods & Examples


GET
http://services.odata.org/V4/(S(jndgbgy2tbu1vjtzyoei2w3e))/TripPinServiceRW/<SPECIFY_PARENT_RESOURCE(KEY)>/Microsoft.OData.SampleService.Models.TripPin.Flight

Request

Content-type: application/json

Response

Event

Event Properties

nametypeDescriptionnullable
DescriptionEdm.String
OccursAtMicrosoft.OData.SampleService.Models.TripPin.EventLocationfalse

Event Representation

{
  "@odata.type": "Microsoft.OData.SampleService.Models.TripPin.Event",
  "Description": "",
  "OccursAt": {
    "BuildingInfo": "",
    "Address": "",
    "City": {
      "CountryRegion": "",
      "Name": "",
      "Region": ""
    }
  },
  "PlanItemId": 0,
  "ConfirmationCode": "",
  "StartsAt": "2016-07-25T11:45:16Z",
  "EndsAt": "2016-07-25T11:45:16Z",
  "Duration": ""
}

Event Methods & Examples


GET
http://services.odata.org/V4/(S(jndgbgy2tbu1vjtzyoei2w3e))/TripPinServiceRW/<SPECIFY_PARENT_RESOURCE(KEY)>/Microsoft.OData.SampleService.Models.TripPin.Event

Request

Content-type: application/json

Response

Trip

Trip Properties

nametypeDescriptionnullable
TripId ๐Ÿ”‘Edm.Int32false
ShareIdEdm.Guid
DescriptionEdm.String
NameEdm.Stringfalse
BudgetEdm.Singlefalse
StartsAtEdm.DateTimeOffsetfalse
EndsAtEdm.DateTimeOffsetfalse
TagsCollection(Edm.String)false

Trip Relations

nameEntity TypeDescriptionextensionsTypecontainsTarget
PhotosPhotoCollection(Microsoft.OData.SampleService.Models.TripPin.Photo)
PlanItemsPlanItemCollection(Microsoft.OData.SampleService.Models.TripPin.PlanItem)true

Trip Representation

{
  "@odata.type": "Microsoft.OData.SampleService.Models.TripPin.Trip",
  "TripId": 0,
  "ShareId": "",
  "Description": "",
  "Name": "",
  "Budget": 0,
  "StartsAt": "2016-07-25T11:45:16Z",
  "EndsAt": "2016-07-25T11:45:16Z",
  "Tags": [
    ""
  ]
}

Trip Methods & Examples


GET
http://services.odata.org/V4/(S(jndgbgy2tbu1vjtzyoei2w3e))/TripPinServiceRW/<SPECIFY_PARENT_RESOURCE(KEY)>/Trip

Request

Content-type: application/json

Response

Complex Types

City

City Properties

nametypeDescriptionnullable
CountryRegionEdm.Stringfalse
NameEdm.Stringfalse
RegionEdm.Stringfalse

Location

Location Properties

nametypeDescriptionnullable
AddressEdm.Stringfalse
CityMicrosoft.OData.SampleService.Models.TripPin.Cityfalse

EventLocation

EventLocation Properties

nametypeDescription
BuildingInfoEdm.String

AirportLocation

AirportLocation Properties

nametypeDescriptionnullableSRID
LocEdm.GeographyPointfalse4326

Actions

ResetDataSource

ResetDataSource Properties

N/A

ResetDataSource Methods & Examples


GET
http://

Request

Content-type: application/json

Response

ShareTrip

ShareTrip Properties

nametypeDescriptionnullable
personMicrosoft.OData.SampleService.Models.TripPin.Personfalse
userNameEdm.Stringfalse
tripIdEdm.Int32false

ShareTrip Methods & Examples


GET
http://

Request

Content-type: application/json

Response

Functions

GetFavoriteAirline

GetFavoriteAirline Parameters and Return Type

nametypeDescriptionnullable
personMicrosoft.OData.SampleService.Models.TripPin.Personfalse
ReturnTypeMicrosoft.OData.SampleService.Models.TripPin.Airline

GetFavoriteAirline Methods & Examples


GET
http://

Request

Content-type: application/json

Response

GetInvolvedPeople

GetInvolvedPeople Parameters and Return Type

nametypeDescriptionnullable
tripMicrosoft.OData.SampleService.Models.TripPin.Tripfalse
ReturnTypeCollection(Microsoft.OData.SampleService.Models.TripPin.Person)

GetInvolvedPeople Methods & Examples


GET
http://

Request

Content-type: application/json

Response

GetFriendsTrips

GetFriendsTrips Parameters and Return Type

nametypeDescriptionnullable
personMicrosoft.OData.SampleService.Models.TripPin.Personfalse
userNameEdm.Stringfalse
ReturnTypeCollection(Microsoft.OData.SampleService.Models.TripPin.Trip)

GetFriendsTrips Methods & Examples


GET
http://

Request

Content-type: application/json

Response

GetNearestAirport

GetNearestAirport Parameters and Return Type

nametypeDescriptionnullable
latEdm.Doublefalse
lonEdm.Doublefalse
ReturnTypeMicrosoft.OData.SampleService.Models.TripPin.Airport

GetNearestAirport Methods & Examples


GET
http://

Request

Content-type: application/json

Response