Skip to content

Instantly share code, notes, and snippets.

@Basitomania
Created May 26, 2022 14:30
Show Gist options
  • Save Basitomania/27016bd2ea47df246d9ee8b3e5abacb9 to your computer and use it in GitHub Desktop.
Save Basitomania/27016bd2ea47df246d9ee8b3e5abacb9 to your computer and use it in GitHub Desktop.
Fetch Cities
```
const URL = https://staging.plentywaka.com/api/v2/tes-park-web/locations
```
example usage
```
const getLocations = async (data, domain) => {
const customerHeaders = {
Accept: 'application/json',
'Content-Type': `application/json`,
'x-api-key': domain
}
const url = `${URL}`;
try {
const response = await axios.post(url, data, { headers: customerHeaders });
if (response) {
console.log('response', response)
}
} catch (error) {
console.log('error', error)
}
}
```
Fetch Itineries
To fecth Itineries, the search should redirect to this url with the following query params
```
url = https://staging.tes.booking.treepz.com query params = departure, arrival, departureDate, seatCount, domain
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment