Viewing a Job Definition

The GET method with a specific job ID retrieves the detailed information about that scheduled job.

Method

URL

GET

http://<host>:<port>/jasperserver[-pro]/rest_v2/jobs/<jobID>/

Options

accept: application/xml (default)

accept: application/job+json

Return Value on Success

Typical Return Values on Failure

200 OK – The body contains XML that describes all the job properties.

404 Not Found – When the specified job is not found in the server.

The GET method returns a job element that gives the output, scheduling, and parameter details, if any, for the job.

The job XML element returned by the rest_v2/jobs service has a different structure than the element with the same name returned by the rest/job service.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<job> 
  <baseOutputFilename>AllAccounts</baseOutputFilename> 
  <repositoryDestination> 
    <folderURI>/reports/samples</folderURI> 
    <id>2041</id> 
    <outputDescription/> 
    <overwriteFiles>false</overwriteFiles> 
    <sequentialFilenames>false</sequentialFilenames> 
    <version>0</version> 
  </repositoryDestination> 
  <description/> 
  <id>2042</id> 
  <label>MyNewJob</label> 
  <mailNotification>
    <bccAddresses/>
    <ccAddresses/>
    <id>2007</id>
    <includingStackTraceWhenJobFails>false</includingStackTraceWhenJobFails>
    <messageText>Body of message</messageText><
    resultSendType>SEND_ATTACHMENT</resultSendType>
    <skipEmptyReports>true</skipEmptyReports>
    <skipNotificationWhenJobFails>false</skipNotificationWhenJobFails>
    <subject>Subject of message</subject>
    <toAddresses><address>name@example.com</address></toAddresses>
    <version>0</version>
  </mailNotification>
  <outputFormats>
    <outputFormat>XLS</outputFormat>
    <outputFormat>CSV</outputFormat>
    <outputFormat>PDF</outputFormat>
    <outputFormat>HTML</outputFormat>
    <outputFormat>DOCX</outputFormat>
  </outputFormats>
  <outputLocale/> 
  <reportUnitURI>/reports/samples/AllAccounts</reportUnitURI> 
  <simpleTrigger> 
    <id>2040</id> 
    <startDate>2222-02-04T03:47:00+02:00</startDate> 
    <timezone>America/Los_Angeles</timezone> 
    <version>0</version> 
    <occurrenceCount>1</occurrenceCount> 
  </simpleTrigger> 
  <version>1</version> 
</job>

As of JasperReports Server 5.5, the v2/jobs service also supports the extended application/job+json syntax. This format allows you to specify the scheduler features introduced in release 5.5, such as alert messages:

{
    "id": 3819,
    "version": 0,
    "username": "superuser",
    "label": "test",
    "description": "",
    "creationDate": "2013-08-30T02:02:40.382+03:00",
    "trigger": {
        "simpleTrigger": {
            "id": 3816,
            "version": 0,
            "timezone": "America/Los_Angeles",
            "calendarName": null,
            "startType": 2,
            // startDate format is yyyy-MM-dd HH:mm
            // time zone specified in a 'timezone' filed getting applied on a server
            "startDate": "2013-09-26 10:00",
            // endDate format is yyyy-MM-dd HH:mm
            // time zone specified in a 'timezone' filed getting applied on a server
            "endDate": null,
            "misfireInstruction": 0,
            "occurrenceCount": 1,
            "recurrenceInterval": null
        }
    },
    "source": {
        "reportUnitURI": "/organizations/organization_1/reports/samples/Cascading_multi_select_report",
        "parameters": {
            "parameterValues": {
                "Country_multi_select": ["Mexico"],
                "Cascading_name_single_select": ["Chin-Lovell Engineering Associates"],
                "Cascading_state_multi_select": ["DF","Jalisco","Mexico"]
            }
        }
    },
    "baseOutputFilename": "Cascading_multi_select_report",
    "outputLocale": "",
    "mailNotification": null,
    "alert": {
        "id": 0,
        "version": -1,
        "recipient": "OWNER_AND_ADMIN",
        "toAddresses": {
            "address": []
        },
        "jobState": "FAIL_ONLY",
        "messageText": null,
        "messageTextWhenJobFails": null,
        "subject": null,
        "includingStackTrace": true,
        "includingReportJobInfo": true
    },
    "outputTimeZone": "America/Los_Angeles",
    "repositoryDestination": {
        "id": 3817,
        "version": 0,
        "folderURI": "/organizations/organization_1/reports/samples",
        "sequentialFilenames": false,
        "overwriteFiles": false,
        "outputDescription": "",
        "timestampPattern": null,
        "saveToRepository": true,
        "defaultReportOutputFolderURI": null,
        "usingDefaultReportOutputFolderURI": false,
        "outputLocalFolder": null,
        "outputFTPInfo": {
            "userName": null,
            "password": null,
            "folderPath": null,
            "serverName": null
        }
    },
    "outputFormats": {
        "outputFormat": ["PDF"]
    }
}

Version: 
Feedback
randomness