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"
}スケジュールの作成
指定された時間にAPIコールを実行する新しいスケジュールを作成します。一度きりの実行とcron式を使用した定期的なスケジュールの両方をサポートしています。自然言語テキストを使用してcron式を自動生成することもできます。
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"
}承認
Bearer認証ヘッダーの形式はBearer で、はあなたの認証トークンです。
ボディ
スケジュールされた API コールの HTTP メソッド。GET または POST のいずれかでなければなりません。
GET, POST スケジュールが実行されるときに呼び出されるエンドポイント URL。Olostep エンドポイントを使用した POST リクエストの場合、短縮形(例: 'v1/scrapes', 'v1/batches', 'v1/crawls', 'v1/maps', 'v1/answers')を使用することができ、自動的に 'https://api.olostep.com/' がプレフィックスされます。他のエンドポイントの場合は、完全な URL を提供してください。
API コールと共に送信するペイロード。必要な任意の JSON 構造を含めることができます。GET リクエストの場合、通常は空です。POST リクエストの場合、エンドポイントに送信したいデータを含める必要があります。
定期的なスケジュールのための 6 フィールド形式(分 時間 日 月 曜日 年)の cron 式。定期的なスケジュールには必須です。execute_at および text とは相互排他的です。
一度きりのスケジュール実行のための ISO 8601 日時文字列。有効な未来の日時でなければなりません。一度きりのスケジュールには必須です。cron_expression とは相互排他的です。
スケジュールのための IANA タイムゾーン識別子(例: 'UTC', 'America/New_York', 'Europe/London')。定期的なスケジュールには必須で、一度きりのスケジュールにはオプションです。自然言語テキストを使用する場合、デフォルトは 'UTC' です。
自動的に cron 式を生成するための自然言語テキスト。システムはあなたのテキストを有効な cron 式に変換します。例: 'every 3 minutes', 'every day at 10am', 'every Monday at 9am'。cron_expression および execute_at とは相互排他的です。使用する場合、expression_timezone のデフォルトは 'UTC' です。
レスポンス
スケジュールが正常に作成されました。
ユニークなスケジュール識別子
スケジュールのタイプ: cron ベースのスケジュールには 'recurring'、単一実行スケジュールには 'onetime'
recurring, onetime スケジュールされたコールの HTTP メソッド
GET, POST 呼び出されるエンドポイント URL
Cron 式(定期的なスケジュールの場合のみ存在)
実行日時(一度きりのスケジュールの場合のみ存在)
スケジュールのタイムゾーン
スケジュールが作成された ISO 8601 日時
このページは役に立ちましたか?