2018-07-24 18:16:14 +02:00
# `refreshJourney(refreshToken, [opt])`
`refreshToken` must be a string, taken from `journey.refreshToken` .
With `opt` , you can override the default options, which look like this:
```js
{
stopovers: false, // return stations on the way?
polylines: false, // return a shape for each leg?
tickets: false, // return tickets? only available with some profiles
2020-03-18 20:04:39 +01:00
subStops: true, // parse & expose sub-stops of stations?
entrances: true, // parse & expose entrances of stops/stations?
2018-07-24 18:16:14 +02:00
remarks: true, // parse & expose hints & warnings?
language: 'en' // language to get results in
}
```
## Response
As an example, we're going to use the [VBB profile ](../p/vbb ):
```js
2022-05-07 16:17:37 +02:00
import {createClient} from 'hafas-client'
import {vbbProfile} from 'hafas-client/p/vbb.js'
2018-07-24 18:16:14 +02:00
const client = createClient(vbbProfile)
// Hauptbahnhof to Heinrich-Heine-Str.
2021-12-29 16:59:31 +01:00
const {journeys} = await client.journeys('900000003201', '900000100008', {results: 1})
// later, fetch up-to-date info on the journey
2022-04-28 22:59:19 +02:00
const {
journey,
realtimeDataUpdatedAt,
} = await client.refreshJourney(journeys[0].refreshToken, {stopovers: true, remarks: true})
2018-07-24 18:16:14 +02:00
```
2021-12-29 21:14:50 +01:00
`journey` is a *single* [*Friendly Public Transport Format* v2 draft ](https://github.com/public-transport/friendly-public-transport-format/blob/3bd36faa721e85d9f5ca58fb0f38cdbedb87bbca/spec/readme.md ) `journey` , in the same format as returned by [`journeys()` ](journeys.md ).
`realtimeDataUpdatedAt` is a UNIX timestamp reflecting the latest moment when (at least some of) the response's realtime data have been updated.