As in the UI, Fetches for a Datastream can be triggered through the API. There are 2 options:
- Trigger a single fetch job.
- Prompt multiple fetch jobs according to configured time range.
The following parameters are required:
- START: The start timestamp of the time window to fetch, in UTC.
- END: The end timestamp for the time window, in UTC.
TRIGGER ONE FETCH WITHIN A SPECIFIED TIME RANGE
(Equivalent to "Run a manual fetch" in the UI)
Use api/datastreams/DATASTREAM_ID/fetch_fixed/ .
curl -X POST \
https://YOUR_STACK.datatap.adverity.com/api/datastreams/DATASTREAM_ID/fetch_fixed/ \
-H 'Authorization: Token TOKEN_VALUE' \
-H 'Content-Type: application/json' \
-d '{"start":"YYYY-MM-DDTHH:MM:SSZ","end":"YYYY-MM-DDTHH:MM:SSZ"}'
Result
{
"status": "ok",
"start": "YYYY-MM-DDTHH:MM:SSZ",
"message": "Fetch scheduled.",
"end": "YYYY-MM-DDTHH:MM:SSZ"
}
PROMPT MULTIPLE FETCH JOBS ACCORDING TO A CONFIGURED TIME RANGE
(Equivalent to "Scheduled fetches" in the UI)
Use api/datastreams/DATASTREAM_ID/fetch/.
curl -X POST \
https://YOUR_STACK.datatap.adverity.com/api/datastreams/DATASTREAM_ID/fetch/ \
-H 'Authorization: Token TOKEN_VALUE' \
-H 'Content-Type: application/json' \
-d '{"start":"YYYY-MM-DDTHH:MM:SSZ","end":"YYYY-MM-DDTHH:MM:SSZ", "force":"false", "callback":"https://CALLBACK_URL"}'
Note: When including the CALLBACK parameter, it must be a valid callback URL, otherwise an error will be returned. The callback contains several parameters providing information like the extract state, file name and file size.
Comments
0 comments
Article is closed for comments.