Check Job Status

After your job has been submitted you can check on its status by doing a GET call on /jobs/ 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 submitting a job.

# 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 status_code 201
print(r.status_code)

# Display the full XML returned.
print(r.text)

Example returned XML with both a status

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<job>
    <id>538024</id>
    <status>9</status>
    <description>Editing</description>
    <statusUrl>https://stage-rest.click2mail.com/molpro/jobs/538024</statusUrl>
</job>

Possible Job Statuses

Status

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.