async
params => {
}
const config = {
method: params.method,
url: params.url,
params: params.query,
headers: params.headers,
responseType: params.responseType,
data: params.data,
}
if (params.auth) config.auth = params.auth
return await require("@pipedreamhq/platform").axios(this, config)
The format component of the URL should be replaced with one of the following json, geojson, xml, map or google-v3-json.
A latitude, longitude or a placename/address. The query should be URL encoded, so spaces should be a +, comma should be %2C, instead of, for example, non-ascii strings like München you should send us M%C3%BCnchen.
async
(params, auths) => {
}
return await require("@pipedreamhq/platform").axios(this, {
url: `https://api.opencagedata.com/geocode/v1/${params.format}`,
params: {
key: auths.opencage.api_key,
q: params.q,
abbrv: params.abbrv,
add_request: params.add_request,
bounds: params.bounds,
countrycode: params.countrycode,
jsonp: params.jsonp,
language: params.language,
limit: params.limit,
min_confidence: params.min_confidence,
no_annotations: params.no_annotations,
no_dedupe: params.no_dedupe,
no_record: params.no_record,
pretty: params.pretty,
proximity: params.proximity,
roadinfo: params.roadinfo,
},
})
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
return `http://www.google.com/maps/place/${steps.get_iss_position.$return_value.iss_position.latitude},${steps.get_iss_position.$return_value.iss_position.longitude}/@${steps.get_iss_position.$return_value.iss_position.latitude},${steps.get_iss_position.$return_value.iss_position.longitude},1z`
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
// To use npm packages like Moment.js, just require them
const moment = require('moment')
// Finally, we'll reference the data returned by the Open Notify
// API in the previous step and output a human readable summary.
return `The International Space Station was passing over ${steps.geocoder_request.$return_value.results[0].formatted} on ${moment(steps.get_iss_position.$return_value.timestamp*1000)} ${steps.generate_maps_url.$return_value}`
async
(params, auths) => {
}
const axios = require('axios')
const {status, in_reply_to_status_id, auto_populate_reply_metadata, exclude_reply_user_ids, attachment_url, media_ids, possibly_sensitive, lat, long, place_id, display_coordinates, trim_user, enable_dmcommands, fail_dmcommands, card_uri} = params
const body = {
config: {
url: `https://api.twitter.com/1.1/statuses/update.json`,
method: 'POST',
params,
},
token: {
key: auths.twitter.oauth_access_token,
secret: auths.twitter.oauth_refresh_token,
},
}
const proxy = "https://api.pipedream.com/v1/oauth1/app_13GhY1"
const resp = await axios.post(proxy,body)
const {messages, data} = resp.data
for (const message of messages) {
console.log(message)
}
return data