UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 6.52 kB
{"openapi":"3.0.0","info":{"description":"\nBefore using this API, we recommend you read our **[Authorization Guide](https://developers.amadeus.com/self-service/apis-docs/guides/authorization-262)** for more information on how to generate an access token.","title":"Trip Purpose Prediction","version":"1.1.4","x-logo":{"url":"https://amadeus.com/images/en/technology/mobile-tablet/mobile-woman-office-city.jpg.transform/medium/img.jpg"},"x-origin":[{"format":"swagger","url":"https://raw.githubusercontent.com/amadeus4dev/amadeus-open-api-specification/main/spec/json/TripPurposePrediction_v1_swagger_specification.json","version":"2.0"}],"x-providerName":"amadeus.com","x-release-note":{"1.0":["Initial Version"],"1.1":["Remove self section from data","Add defaults to meta","Change result into an enum"]},"x-serviceName":"amadeus-trip-purpose-prediction","x-status":"validated","x-tags":["#ama-for-dev"]},"paths":{"/travel/predictions/trip-purpose":{"get":{"description":"","operationId":"getTripPurposePrediction","parameters":[{"description":"city/airport [IATA code](http://www.iata.org/publications/Pages/code-search.aspx) from which the traveler will depart, e.g. BOS for Boston","in":"query","name":"originLocationCode","required":true,"example":"NYC","schema":{"type":"string","pattern":"[A-Z]{3}"}},{"description":"city/airport [IATA code](http://www.iata.org/publications/Pages/code-search.aspx) to which the traveler is going, e.g. PAR for Paris","in":"query","name":"destinationLocationCode","required":true,"example":"MAD","schema":{"type":"string","pattern":"[A-Z]{3}"}},{"description":"the date on which the traveler will depart from the origin to go to the destination. Dates are specified in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) YYYY-MM-DD format, e.g. 2017-12-25","in":"query","name":"departureDate","required":true,"example":"2025-06-15T13:47:10.223Z","schema":{"type":"string"}},{"description":"the date on which the traveler will depart from the destination to return to the origin. Dates are specified in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) YYYY-MM-DD format, e.g. 2018-02-28","in":"query","name":"returnDate","required":true,"example":"2025-06-15T13:47:10.223Z","schema":{"type":"string"}},{"description":"the date on which the traveler is performing the search. If this parameter is not specified, current date will be used. Dates are specified in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) YYYY-MM-DD format, e.g. 2018-02-28","in":"query","name":"searchDate","required":false,"schema":{"type":"string"}}],"responses":{"200":{"$ref":"#/components/responses/200"},"400":{"$ref":"#/components/responses/400"},"default":{"$ref":"#/components/responses/500"}},"summary":"Returns the forecast purpose of a trip","tags":["trip-purpose-prediction"]}}},"x-generatedAt":"2025-06-15T13:47:10.223Z","servers":[{"url":"https://test.api.amadeus.com/v1"}],"components":{"responses":{"200":{"description":"Success","content":{"application/vnd.amadeus+json":{"schema":{"$ref":"#/components/schemas/Prediction"}}}},"400":{"description":"code | title \n------- | ------------------------------------- \n477 | INVALID FORMAT\n572 | INVALID OPTION\n4926 | INVALID DATA RECEIVED \n32171 | MANDATORY DATA MISSING \t \n","content":{"application/vnd.amadeus+json":{"schema":{"$ref":"#/components/schemas/Error_400"}}}},"500":{"description":"Unexpected Error","content":{"application/vnd.amadeus+json":{"schema":{"$ref":"#/components/schemas/Error_500"}}}}},"schemas":{"Defaults":{"description":"the query parameters for which default values were used are returned here","properties":{"searchDate":{"description":"the date on which the traveler is performing the search.","example":"2025-06-15T13:47:10.223Z","type":"string"}},"type":"object"},"Error_400":{"example":{"errors":[{"code":477,"detail":"invalid query parameter format","source":{"example":"CDG","parameter":"airport"},"status":400,"title":"INVALID FORMAT"}]},"properties":{"errors":{"items":{"$ref":"#/components/schemas/Issue"},"type":"array"}},"required":["errors"]},"Error_500":{"example":{"errors":[{"code":141,"status":500,"title":"SYSTEM ERROR HAS OCCURRED"}]},"properties":{"errors":{"items":{"$ref":"#/components/schemas/Issue"},"type":"array"}},"required":["errors"]},"Issue":{"properties":{"code":{"description":"an application-specific error code","format":"int64","type":"integer"},"detail":{"description":"explanation of the error","type":"string"},"source":{"description":"an object containing references to the source of the error","maxProperties":1,"properties":{"example":{"description":"a string indicating an example of the right value","type":"string"},"parameter":{"description":"a string indicating which URI query parameter caused the issue","type":"string"},"pointer":{"description":"a JSON Pointer [RFC6901] to the associated entity in the request document","type":"string"}},"title":"Issue_Source","type":"object"},"status":{"description":"the HTTP status code applicable to this error","type":"integer"},"title":{"description":"a short summary of the error","type":"string"}}},"Links":{"properties":{"related":{"format":"uri","type":"string"},"self":{"format":"uri","type":"string"},"type":{"type":"string"}}},"Meta":{"properties":{"defaults":{"$ref":"#/components/schemas/Defaults"},"links":{"$ref":"#/components/schemas/Links"}},"type":"object"},"Prediction":{"example":{"data":{"id":"NYCMAD20231201","probability":"0.9995216","result":"LEISURE","subType":"trip-purpose","type":"prediction"},"meta":{"defaults":{"searchDate":"2025-06-15T13:47:10.223Z"},"links":{"self":"https://test.api.amadeus.com/v1/travel/predictions/trip-purpose?originLocationCode=NYC&destinationLocationCode=MAD&departureDate=2023-12-01&returnDate=2023-12-12&searchDate=2023-01-12"}}},"properties":{"data":{"$ref":"#/components/schemas/Purpose_Prediction"},"meta":{"$ref":"#/components/schemas/Meta"}},"type":"object"},"PredictionResultType":{"description":"forecast description","enum":["BUSINESS","LEISURE"],"example":"BUSINESS","type":"string"},"Purpose_Prediction":{"properties":{"id":{"description":"item identifier","readOnly":true,"type":"string"},"probability":{"description":"probability of the forecast (between 0 and 1)","type":"string"},"result":{"$ref":"#/components/schemas/PredictionResultType"},"subType":{"example":"trip-purpose","type":"string"},"type":{"description":"the resource name (`prediction`)","type":"string"}}}}}}