Provides API endpoints related to api/schedules
Summary
Functions
Create schedule
Delete schedule
Get schedule
Invoke schedule
Get list of schedules
Get schedule log
Update schedule
Functions
@spec create( body :: map() | ApifyClient.Schemas.CreateOrUpdateScheduleRequest.t(), opts :: keyword() ) :: {:ok, ApifyClient.Schemas.Schedule.t()} | {:error, ApifyClient.Error.t()}
Create schedule
Creates a new schedule with settings provided by the schedule object passed as JSON in the payload. The response is the created schedule object.
The request needs to specify the Content-Type: application/json HTTP header!
When providing your API authentication token, we recommend using the
request's Authorization header, rather than the URL.
For details, see Authentication.
Request Body
Content Types: application/json
@spec delete(schedule_id :: String.t(), opts :: keyword()) :: :ok | {:error, ApifyClient.Error.t()}
Delete schedule
Deletes a schedule.
@spec get(schedule_id :: String.t(), opts :: keyword()) :: {:ok, ApifyClient.Schemas.Schedule.t()} | {:error, ApifyClient.Error.t()}
Get schedule
Gets the schedule object with all details.
@spec invoke(schedule_id :: String.t(), opts :: keyword()) :: {:ok, map() | nil} | {:error, ApifyClient.Error.t()}
Invoke schedule
Immediately runs all actions of the schedule, the same way as the Run now button in Apify Console.
The invocation is recorded in the schedule log. It doesn't change the schedule's
lastRunAt or nextRunAt. The response doesn't contain the started runs.
@spec list(opts :: keyword()) :: {:ok, ApifyClient.Schemas.ListOfSchedules.t()} | {:error, ApifyClient.Error.t()}
Get list of schedules
Gets the list of schedules that the user created.
The endpoint supports pagination using the limit and offset parameters.
It will not return more than 1000 records.
By default, the records are sorted by the createdAt field in ascending
order. To sort the records in descending order, use the desc=1 parameter.
Options
offset: Number of items that should be skipped at the start. The default value is0.limit: Maximum number of items to return. The default value as well as the maximum is1000.desc: Iftrueor1then the objects are sorted by thecreatedAtfield in descending order. By default, they are sorted in ascending order.
@spec log(schedule_id :: String.t(), opts :: keyword()) :: {:ok, [ApifyClient.Schemas.ScheduleLogEntry.t()]} | {:error, ApifyClient.Error.t()}
Get schedule log
Gets the schedule log as a JSON array containing information about up to a 1000 invocations of the schedule.
@spec update( schedule_id :: String.t(), body :: map() | ApifyClient.Schemas.CreateOrUpdateScheduleRequest.t(), opts :: keyword() ) :: {:ok, ApifyClient.Schemas.Schedule.t()} | {:error, ApifyClient.Error.t()}
Update schedule
Updates a schedule using values specified by a schedule object passed as JSON in the POST payload. If the object does not define a specific property, its value will not be updated.
The response is the full schedule object as returned by the Get schedule endpoint.
The request needs to specify the Content-Type: application/json HTTP
header!
When providing your API authentication token, we recommend using the
request's Authorization header, rather than the URL.
For details, see Authentication.
Request Body
Content Types: application/json