Check Job Status
After your job has been submitted, you can check on its status by doing a GET call on /jobs/{id} endpoint using the ID returned from the /jobs call that created the job. This is an optional call that you can also check through the website as well even if you submitted your job via API.
The following code sample demonstrates checking the status of job ID 8675309:
# Load the HTTP requests module
import requests
# Note the ID of the previously-created job
jobId = '8675309'
# Define the endpoint to use, including the jobId
url = "https://stage-rest.click2mail.com/molpro/jobs/" + jobId
# Define credentials
myusername = 'awesomeuser'
mypassword = 'gReAt/PaSsWoRd123'
headers = {'user-agent': 'my-app/0.0.1'}
# Make the GET call
r = requests.get(url, headers=headers, auth=(myusername, mypassword))
# Display the result - a success should return an HTTP status_code 201
print(r.status_code)
# Display the full XML returned.
print(r.text)
If the GET call is successful, it will return an HTTP status code of 201, along with an XML body containing a job status description. For example, the following XML reports a status of "Editing". The full list of possible statuses is shown below.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<job>
<id>8675309</id>
<status>9</status>
<description>Editing</description>
<statusUrl>https://stage-rest.click2mail.com/molpro/jobs/538024</statusUrl>
</job>
Possible Job Statuses
Status Description | Description |
---|---|
EDITING | User has created a job but has not yet submitted it |
PROOF_ACCEPTED | User has accepted Proof -- this is only come into play if you call the REST API POST /jobs/{id}/proof/accept |
ORDER_SUBMITTED | Job has been submitted |
AWAITING_PRODUCTION | Job has been processed and ready to be sent to printer |
IN_PRODUCTION | Job has been sent to printer |
MAILED | Job has been printed and given to USPS facility |
ERROR | There has been a problem processing this job. Very rare. C2M will contact the customer if a job is in error for any reason. |
ON_HOLD | Very rare. For some reason C2M has put this job on hold. C2M will contact the customer if a job has to be put on hold for any reason. |
Updated 8 months ago