untitled notebook

node v8.9.3
version: 1.0.0
endpointsharetweet
const getInfoSkyscannerJSON = (data) => { const deeplinkText = `this is a link ${data.DeeplinkUrl}`; return { message: [ {text:deeplinkText} ] } }; const requestPromise = require('request-promise'); const requestOptions = { method: 'POST', uri: 'http://partners.api.skyscanner.net/apiservices/pricing/v1.0', body: { cabinclass: 'Economy', country: 'UK', originplace: 'CDG', destinationplace: 'LHR', outbounddate: '2017-12-12', inbounddate: '2017-12-20', adults: '1', apikey: 'apiKey' // Add more properties from the API }, json: true }; requestPromise(requestOptions) .then((data) => { const responseData = getInfoSkyscannerJSON(data) reponse.json(responseData); });
Loading…

no comments

    sign in to comment