Can I use Terra API endpoints without webhooks?

HighCondor9 months ago

I do not wish to create a Webhook and wait for user data. I want 2 weeks of user data the moment they connect.

terra

Alexadmin9 months ago

Yes, you can set 'to_webhook' to false and directly get data via request return, which is useful for development and testing, but can also be used in production. For example, the following request will get you 2 weeks of activity data:

curl --location 'https://api.tryterra.co/v2/activity?user_id=[USER-ID]&start_date=2024-03-01&to_webhook=false&with_samples=true' \ --header 'dev-id: [YOUR-DEV-ID]' \ --header 'x-api-key: [YOUR-API-KEY]'

However, if you wish to query more than one month of data in a single request - you will need to have a webhook or alternate destination setup as we will send the data in batches. Or you can break up the quest into several requests with smaller time ranges.


Cookie Preferences

Essential CookiesAlways On
Advertisement Cookies
Analytics Cookies

Crunch Time: Embrace the Cookie Monster Within!

We use cookies to enhance your browsing experience and analyse our traffic. By clicking “Accept All”, you consent to our use of cookies according to our Cookie Policy. You can change your mind any time by visiting out cookie policy.