Get scheduling job

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Reports on a scheduling job started by Start scheduling posts.

Poll it until status is completed or failed. A completed job carries result, the count of what happened to each post it took on. A failed job leaves result empty and sets error to a fixed message that says nothing about the cause. The posts it had already dealt with keep the status that run gave them, and the rest are untouched, so you can start scheduling the same range again.

get/api/apps/{app_id}/social-calendar/posts/schedule/{job_id}

Path parameters

job_idstring required

ID of the scheduling job, as returned by Start scheduling posts.

ID of the scheduling job, as returned by Start scheduling posts.

app_idstring required

ID of the app whose social calendar you want.

ID of the app whose social calendar you want.

Response

The job's progress, and its result once it completes.

job_idstring required

ID of the scheduling job. Pass it as job_id to Get scheduling job.

statusstring required

State of the job. Either pending, running, completed, or failed. See Scheduling jobs for what each value means. A range holding nothing to schedule comes back completed straight away.

phasestring required

How far the job has got, for display only. Either pending, prepare, sandbox_sync, finalize, or completed. Read status, not phase, to decide when the job is done, since phases change as the pipeline does.

errorstring nullable

Set when status is failed, and null otherwise. It is always the same fixed message and carries no detail about the failure, so treat it as a flag rather than something to parse or show as a reason.

Example response

{
  "job_id": "68a1c4f0d21b4e0a3c77e912",
  "status": "pending",
  "phase": "finalize",
  "result": {
    "selected": 6,
    "materialized": 4,
    "created_workflows": 3,
    "reused_workflows": 1,
    "plan_limited": 1,
    "needs_reconnect": 1
  },
  "error": "Scheduling failed. Please try again."
}

Changes

Changed in 1 of the 18 revisions of this API.1

Of the 18 revisions, 1 has no diff computed.