curl --request POST \
--url https://api.olostep.com/v1/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endpoint": "<string>",
"payload": {},
"cron_expression": "<string>",
"execute_at": "2023-11-07T05:31:56Z",
"expression_timezone": "<string>",
"text": "<string>"
}
'import requests
url = "https://api.olostep.com/v1/schedules"
payload = {
"endpoint": "<string>",
"payload": {},
"cron_expression": "<string>",
"execute_at": "2023-11-07T05:31:56Z",
"expression_timezone": "<string>",
"text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endpoint: '<string>',
payload: {},
cron_expression: '<string>',
execute_at: '2023-11-07T05:31:56Z',
expression_timezone: '<string>',
text: '<string>'
})
};
fetch('https://api.olostep.com/v1/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.olostep.com/v1/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'endpoint' => '<string>',
'payload' => [
],
'cron_expression' => '<string>',
'execute_at' => '2023-11-07T05:31:56Z',
'expression_timezone' => '<string>',
'text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.olostep.com/v1/schedules"
payload := strings.NewReader("{\n \"endpoint\": \"<string>\",\n \"payload\": {},\n \"cron_expression\": \"<string>\",\n \"execute_at\": \"2023-11-07T05:31:56Z\",\n \"expression_timezone\": \"<string>\",\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.olostep.com/v1/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"<string>\",\n \"payload\": {},\n \"cron_expression\": \"<string>\",\n \"execute_at\": \"2023-11-07T05:31:56Z\",\n \"expression_timezone\": \"<string>\",\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endpoint\": \"<string>\",\n \"payload\": {},\n \"cron_expression\": \"<string>\",\n \"execute_at\": \"2023-11-07T05:31:56Z\",\n \"expression_timezone\": \"<string>\",\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "recurring",
"method": "GET",
"endpoint": "<string>",
"cron_expression": "<string>",
"execute_at": "2023-11-07T05:31:56Z",
"expression_timezone": "<string>",
"created": "2023-11-07T05:31:56Z"
}Schema Maken
Maakt een nieuw schema aan om API-aanroepen op gespecificeerde tijden uit te voeren. Ondersteunt zowel eenmalige uitvoeringen als terugkerende schema’s met behulp van cron-expressies. Je kunt ook natuurlijke taal gebruiken om automatisch cron-expressies te genereren.
curl --request POST \
--url https://api.olostep.com/v1/schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endpoint": "<string>",
"payload": {},
"cron_expression": "<string>",
"execute_at": "2023-11-07T05:31:56Z",
"expression_timezone": "<string>",
"text": "<string>"
}
'import requests
url = "https://api.olostep.com/v1/schedules"
payload = {
"endpoint": "<string>",
"payload": {},
"cron_expression": "<string>",
"execute_at": "2023-11-07T05:31:56Z",
"expression_timezone": "<string>",
"text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
endpoint: '<string>',
payload: {},
cron_expression: '<string>',
execute_at: '2023-11-07T05:31:56Z',
expression_timezone: '<string>',
text: '<string>'
})
};
fetch('https://api.olostep.com/v1/schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.olostep.com/v1/schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'endpoint' => '<string>',
'payload' => [
],
'cron_expression' => '<string>',
'execute_at' => '2023-11-07T05:31:56Z',
'expression_timezone' => '<string>',
'text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.olostep.com/v1/schedules"
payload := strings.NewReader("{\n \"endpoint\": \"<string>\",\n \"payload\": {},\n \"cron_expression\": \"<string>\",\n \"execute_at\": \"2023-11-07T05:31:56Z\",\n \"expression_timezone\": \"<string>\",\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.olostep.com/v1/schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"<string>\",\n \"payload\": {},\n \"cron_expression\": \"<string>\",\n \"execute_at\": \"2023-11-07T05:31:56Z\",\n \"expression_timezone\": \"<string>\",\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"endpoint\": \"<string>\",\n \"payload\": {},\n \"cron_expression\": \"<string>\",\n \"execute_at\": \"2023-11-07T05:31:56Z\",\n \"expression_timezone\": \"<string>\",\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "recurring",
"method": "GET",
"endpoint": "<string>",
"cron_expression": "<string>",
"execute_at": "2023-11-07T05:31:56Z",
"expression_timezone": "<string>",
"created": "2023-11-07T05:31:56Z"
}Autorisaties
Bearer authenticatie header in de vorm Bearer , waar jouw auth token is.
Body
HTTP-methode voor de geplande API-aanroep. Moet GET of POST zijn.
GET, POST De endpoint-URL om aan te roepen wanneer het schema wordt uitgevoerd. Voor POST-verzoeken met Olostep-eindpunten kun je korte vorm gebruiken (bijv. 'v1/scrapes', 'v1/batches', 'v1/crawls', 'v1/maps', 'v1/answers') die automatisch worden geprefixt met 'https://api.olostep.com/'. Voor andere eindpunten, geef de volledige URL op.
De payload om mee te sturen met de API-aanroep. Kan elke JSON-structuur bevatten die je nodig hebt. Voor GET-verzoeken is dit meestal leeg. Voor POST-verzoeken moet dit de gegevens bevatten die je naar het eindpunt wilt sturen.
Cron-expressie in 6 velden formaat (minuut uur dag maand dag-van-de-week jaar) voor terugkerende schema's. Vereist voor terugkerende schema's. Wederzijds exclusief met execute_at en text.
ISO 8601 datetime string voor eenmalige schema-uitvoering. Moet een geldige toekomstige datetime zijn. Vereist voor eenmalige schema's. Wederzijds exclusief met cron_expression.
IANA tijdzone-identificator (bijv. 'UTC', 'America/New_York', 'Europe/London') voor het schema. Vereist voor terugkerende schema's, optioneel voor eenmalige schema's. Bij gebruik van natuurlijke taaltekst is de standaard 'UTC'.
Natuurlijke taaltekst om automatisch een cron-expressie te genereren. Het systeem zal je tekst omzetten in een geldige cron-expressie. Voorbeelden: 'elke 3 minuten', 'elke dag om 10 uur', 'elke maandag om 9 uur'. Wederzijds exclusief met cron_expression en execute_at. Bij gebruik is expression_timezone standaard 'UTC'.
Respons
Schema succesvol aangemaakt.
Unieke schema-identificator
Type schema: 'recurring' voor cron-gebaseerde schema's, 'onetime' voor eenmalige uitvoeringsschema's
recurring, onetime HTTP-methode voor de geplande aanroep
GET, POST De endpoint-URL die zal worden aangeroepen
Cron-expressie (alleen aanwezig voor terugkerende schema's)
Uitvoeringsdatetime (alleen aanwezig voor eenmalige schema's)
Tijdzone voor het schema
ISO 8601 datetime wanneer het schema is aangemaakt
Was deze pagina nuttig?