You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
311 lines
8.0 KiB
311 lines
8.0 KiB
openapi: '3.0.2' |
|
info: |
|
title: RENFE WSMR API |
|
version: '1.0' |
|
servers: |
|
- url: https://wsmr.renfe.es/wsmRestApi/v1/ |
|
paths: |
|
/stations: |
|
get: |
|
operationId: getStations |
|
tags: |
|
- station |
|
summary: List all stations |
|
parameters: |
|
- $ref: '#/components/parameters/app' |
|
- $ref: '#/components/parameters/appVersion' |
|
- $ref: '#/components/parameters/osName' |
|
- $ref: '#/components/parameters/osVersion' |
|
- $ref: '#/components/parameters/language' |
|
responses: |
|
'200': |
|
description: OK |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/GetStationsResponse' |
|
/stations/nearest: |
|
get: |
|
operationId: getNearestStation |
|
tags: |
|
- station |
|
summary: List nearest stations |
|
parameters: |
|
- $ref: '#/components/parameters/app' |
|
- $ref: '#/components/parameters/appVersion' |
|
- $ref: '#/components/parameters/osName' |
|
- $ref: '#/components/parameters/osVersion' |
|
- $ref: '#/components/parameters/language' |
|
- in: query |
|
name: lat |
|
required: true |
|
description: Latitude |
|
schema: |
|
type: number |
|
format: float |
|
example: 41.392710 |
|
- in: query |
|
name: lon |
|
required: true |
|
description: Longitude |
|
schema: |
|
type: number |
|
format: float |
|
example: 2.109310 |
|
responses: |
|
'200': |
|
description: OK |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/GetStationsResponse' |
|
/trains: |
|
get: |
|
tags: |
|
- train |
|
operationId: getTrainList |
|
summary: Find train connections for a specific route |
|
description: This operation uses the v2-Version of the API. Please update the baseUrl accordingly. To get a correct result, you have to specify at least one passenger. |
|
servers: |
|
- url: https://wsmr.renfe.es/wsmRestApi/v2/ |
|
parameters: |
|
- $ref: '#/components/parameters/app' |
|
- $ref: '#/components/parameters/appVersion' |
|
- $ref: '#/components/parameters/osName' |
|
- $ref: '#/components/parameters/osVersion' |
|
- $ref: '#/components/parameters/language' |
|
- $ref: '#/components/parameters/businessFlow' |
|
- in: query |
|
name: outwardStation |
|
required: true |
|
description: Code of outward station |
|
schema: |
|
type: string |
|
example: 60000 |
|
- in: query |
|
name: returnStation |
|
required: true |
|
description: Code of return station |
|
schema: |
|
type: string |
|
example: 71801 |
|
- in: query |
|
name: outwardDate |
|
required: true |
|
description: Date for outward journey (DD-MM-YYYY) |
|
schema: |
|
type: string |
|
format: date |
|
pattern: /([0-9]{2}-[0-9]{2}-[0-9]{4}/ |
|
example: 01-05-2022 |
|
- in: query |
|
name: returnDate |
|
description: Date for return journey (DD-MM-YYYY) |
|
schema: |
|
type: string |
|
format: date |
|
pattern: /([0-9]{2}-[0-9]{2}-[0-9]{4}/ |
|
example: 02-05-2022 |
|
- in: query |
|
name: adult |
|
description: Number of adult passengers |
|
schema: |
|
type: number |
|
format: int |
|
example: 1 |
|
- in: query |
|
name: child |
|
description: Number of children |
|
schema: |
|
type: number |
|
format: int |
|
- in: query |
|
name: babyUnderFour |
|
description: Number of babies under 4 years |
|
schema: |
|
type: number |
|
format: int |
|
- in: query |
|
name: senior |
|
description: Number of senior passengers |
|
schema: |
|
type: number |
|
format: int |
|
- in: query |
|
name: promoCode |
|
description: Promo Code |
|
schema: |
|
type: string |
|
responses: |
|
'200': |
|
description: OK |
|
content: |
|
application/json: |
|
schema: |
|
$ref: '#/components/schemas/GetTrainListResponse' |
|
components: |
|
parameters: |
|
businessFlow: |
|
name: businessFlow |
|
required: false |
|
in: header |
|
schema: |
|
type: string |
|
enum: |
|
- PURCHASE |
|
- DETAIL |
|
- CHANGE |
|
- CANCELATION |
|
app: |
|
name: app |
|
required: true |
|
in: header |
|
schema: |
|
type: string |
|
default: VMR |
|
appVersion: |
|
name: appVersion |
|
required: true |
|
in: header |
|
schema: |
|
type: string |
|
example: 01.00.00 |
|
osName: |
|
name: osName |
|
required: false |
|
in: header |
|
schema: |
|
type: string |
|
example: 0R |
|
osVersion: |
|
name: osVersion |
|
required: true |
|
in: header |
|
schema: |
|
type: string |
|
example: 1 |
|
language: |
|
name: language |
|
required: false |
|
in: header |
|
schema: |
|
type: string |
|
example: 'en' |
|
schemas: |
|
GetTrainListResponse: |
|
type: object |
|
required: |
|
- trainProductsDiscountsOutward |
|
- trainProductsDiscountsReturn |
|
properties: |
|
trainProductsDiscountsOutward: |
|
type: boolean |
|
trainProductsDiscountsReturn: |
|
type: boolean |
|
trainListOutward: |
|
type: array |
|
items: |
|
$ref: '#/components/schemas/Train' |
|
trainListReturn: |
|
type: array |
|
items: |
|
$ref: '#/components/schemas/Train' |
|
GetStationsResponse: |
|
type: object |
|
required: |
|
- station |
|
properties: |
|
station: |
|
type: array |
|
items: |
|
$ref: '#/components/schemas/Station' |
|
lastUpdateStations: |
|
type: string |
|
format: 'date-time' |
|
pattern: /([0-9]{4})-(?:[0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}):([0-9]{2}).([0-9]{3})/ |
|
example: "2022-03-01 01:06:25.034" |
|
Train: |
|
type: object |
|
properties: |
|
originDate: |
|
type: string |
|
format: date |
|
pattern: /([0-9]{2}-[0-9]{2}-[0-9]{4}/ |
|
example: 10-04-2022 |
|
originTime: |
|
type: string |
|
format: time |
|
example: 06:35 |
|
arrivalDate: |
|
type: string |
|
format: date |
|
pattern: /([0-9]{2}-[0-9]{2}-[0-9]{4}/ |
|
example: 10-04-2022 |
|
arrivalTime: |
|
type: string |
|
format: time |
|
example: 09:20 |
|
trainCode: |
|
type: string |
|
example: 06302 |
|
trainDescription: |
|
type: string |
|
example: AVLO |
|
trainOperator: |
|
type: string |
|
example: LC |
|
trainProductCode: |
|
type: string |
|
example: 112 |
|
travelDuration: |
|
type: string |
|
example: 2 h. 45 min. |
|
availableForSale: |
|
type: boolean |
|
blocked: |
|
type: boolean |
|
completed: |
|
type: boolean |
|
trainGroupCodeForm: |
|
type: boolean |
|
travelException: |
|
type: boolean |
|
datosLargoPlazo: |
|
type: object |
|
properties: |
|
rsvLargoPlazo: |
|
type: boolean |
|
originStation: |
|
$ref: '#/components/schemas/TrainStation' |
|
arrivalStation: |
|
$ref: '#/components/schemas/TrainStation' |
|
trainProductsDiscounts: |
|
type: boolean |
|
TrainStation: |
|
type: object |
|
properties: |
|
stationCode: |
|
type: string |
|
example: 71801 |
|
stationDescription: |
|
type: string |
|
example: BCN-SANTS |
|
largeDescription: |
|
type: string |
|
example: BARCELONA-SANTS |
|
saleEnabled: |
|
type: boolean |
|
enabled: |
|
type: boolean |
|
Station: |
|
type: object |
|
properties: |
|
code: |
|
type: string |
|
example: "71801" |
|
description: |
|
type: string |
|
example: "Barcelona-Sans" |
|
stationType: |
|
type: string |
|
example: "1" |