auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
const access_token = 'ACCESS_TOKEN';
const pixel_id = 'PIXEL_ID';
const test_event_code = 'TEST12345'; // Optional, used for debugging, leave empty otherwise
let current_timestamp = Math.floor(new Date() / 1000);
const body =
[{
"event_name": steps.trigger.event.body.event,
"event_time": current_timestamp,
"event_source_url": steps.trigger.event.body.url,
"action_source": "website",
"custom_data" : steps.trigger.event.body.event_data || null,
"user_data": {
"client_ip_address": steps.trigger.event.client_ip,
"client_user_agent": steps.trigger.event.body.user_agent,
"fbp": steps.trigger.event.body.fbp,
"fbc": steps.trigger.event.body.fbclid
}
}];
return {
pixel_id : pixel_id,
access_token : access_token,
body : body,
current_timestamp: current_timestamp,
test_event_code : test_event_code
}
Add query parameters as key-value pairs
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)