Get Job Status
curl --request POST \
--url https://api.docswrite.com/api/job/status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jobId": "job-abc123",
"queueType": "post"
}
'import requests
url = "https://api.docswrite.com/api/job/status"
payload = {
"jobId": "job-abc123",
"queueType": "post"
}
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({jobId: 'job-abc123', queueType: 'post'})
};
fetch('https://api.docswrite.com/api/job/status', 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.docswrite.com/api/job/status",
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([
'jobId' => 'job-abc123',
'queueType' => 'post'
]),
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.docswrite.com/api/job/status"
payload := strings.NewReader("{\n \"jobId\": \"job-abc123\",\n \"queueType\": \"post\"\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.docswrite.com/api/job/status")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jobId\": \"job-abc123\",\n \"queueType\": \"post\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.docswrite.com/api/job/status")
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 \"jobId\": \"job-abc123\",\n \"queueType\": \"post\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "job-abc123",
"state": "completed",
"progress": 100,
"returnValue": {},
"failedReason": "<string>",
"timestamp": 1234567890,
"processedOn": 1234567890,
"finishedOn": 1234567890
}
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}Endpoints
Job Status
Track the status of your Docswrite publishing jobs
POST
/
api
/
job
/
status
Get Job Status
curl --request POST \
--url https://api.docswrite.com/api/job/status \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"jobId": "job-abc123",
"queueType": "post"
}
'import requests
url = "https://api.docswrite.com/api/job/status"
payload = {
"jobId": "job-abc123",
"queueType": "post"
}
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({jobId: 'job-abc123', queueType: 'post'})
};
fetch('https://api.docswrite.com/api/job/status', 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.docswrite.com/api/job/status",
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([
'jobId' => 'job-abc123',
'queueType' => 'post'
]),
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.docswrite.com/api/job/status"
payload := strings.NewReader("{\n \"jobId\": \"job-abc123\",\n \"queueType\": \"post\"\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.docswrite.com/api/job/status")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"jobId\": \"job-abc123\",\n \"queueType\": \"post\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.docswrite.com/api/job/status")
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 \"jobId\": \"job-abc123\",\n \"queueType\": \"post\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "job-abc123",
"state": "completed",
"progress": 100,
"returnValue": {},
"failedReason": "<string>",
"timestamp": 1234567890,
"processedOn": 1234567890,
"finishedOn": 1234567890
}
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}{
"error": true,
"message": "Invalid Google Docs URL",
"details": "The provided URL is not accessible or not shared properly"
}Additional Information
Usage Examples
Polling for Completion
async function waitForJobCompletion(jobId, token) {
while (true) {
const response = await fetch("https://api.docswrite.com/api/job/status", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-access-token": token,
},
body: JSON.stringify({
jobId: jobId,
queueType: "post",
}),
});
const data = await response.json();
if (data.success && data.data.state === "completed") {
console.log("Job completed successfully!");
break;
} else if (data.success && data.data.state === "failed") {
console.error("Job failed:", data.data.failedReason);
break;
}
// Wait 5 seconds before checking again
await new Promise((resolve) => setTimeout(resolve, 5000));
}
}
Progress Tracking
function trackProgress(jobId, token) {
const interval = setInterval(async () => {
const response = await fetch("https://api.docswrite.com/api/job/status", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-access-token": token,
},
body: JSON.stringify({ jobId, queueType: "post" }),
});
const data = await response.json();
if (data.success) {
console.log(`Progress: ${data.data.progress}%`);
if (data.data.state === "completed" || data.data.state === "failed") {
clearInterval(interval);
}
}
}, 2000);
}
You can only check the status of jobs that you created. The API will return a
403 error if you try to check someone else’s job.
Get Job Status
Check the status of a publishing job using the job ID returned when creating a post.POST https://api.docswrite.com/api/job/status
Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| x-access-token | YOUR_JWT_TOKEN |
Request Body
{
"jobId": "job-123",
"queueType": "post"
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
jobId | string | Yes | The job ID returned when creating a post |
queueType | string | No | Queue type, defaults to “post” |
Response
Success Response (200 OK){
"success": true,
"data": {
"id": "job-123",
"state": "completed",
"progress": 100,
"returnValue": {},
"failedReason": null,
"timestamp": 1234567890,
"processedOn": 1234567890,
"finishedOn": 1234567890
}
}
Job States
| State | Description |
|---|---|
waiting | Job is in the queue waiting to be processed |
active | Job is currently being processed |
completed | Job finished successfully |
failed | Job failed with an error |
delayed | Job is scheduled to run later |
Response Fields
| Field | Type | Description |
|---|---|---|
id | string | The job ID |
state | string | Current state of the job |
progress | number | Progress percentage (0-100) |
returnValue | object | Result data when completed |
failedReason | string | Error message if job failed |
timestamp | number | Job creation timestamp |
processedOn | number | When job processing started |
finishedOn | number | When job finished |
cURL Example
curl -X POST 'https://api.docswrite.com/api/job/status' \
-H 'Content-Type: application/json' \
-H 'x-access-token: YOUR_JWT_TOKEN' \
-d '{
"jobId": "job-123",
"queueType": "post"
}'
Error Responses
Unauthorized (401){
"error": true,
"message": "Unauthorized",
"details": "Invalid or missing access token"
}
{
"error": true,
"message": "Access denied",
"details": "You can only check the status of jobs that you created"
}
{
"error": true,
"message": "Job not found",
"details": "No job found with the provided ID"
}
Authorizations
JWT token for authenticated requests
Body
application/json
Job status request
Was this page helpful?
⌘I
