Get time entries | TimeCamp API
This is the specific api I am trying to get working. The issue I am having, is that I need to pass two ‘date’ strings as part of the URL it seems. But when I try it, I get an unexpected token error, so I assume that the syntax I’m using is incorrect for pipedream.
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
timecamp: {
type: "app",
app: "timecamp",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://app.timecamp.com/third_party/api/entries?from=05%2F06%2F2022&to=05%2F06%2F2022',
headers: {
"Authorization": `${this.timecamp.$auth.api_token}`,
},
})
},
})
Any help or guidance would be appreciated! In fact, I want the url link parameters to not be a fixed date like in the example, but to always be yesterdays date. I have a step set up using moment() to get the date and subtract 1, but I can’t test if its working because it doesn’t seem to output anything (though pipedream is saying it’s successful without any errors). I’m ignoring it for now until I can actually get the timecamp api working for time entries though.
Thankyou!