Agent.GetJobs

Prev Next

Description

Returns a list of your agent’s jobs with detailed information.

URL parameters

URL parameter ordering

The URL parameters below are listed in the order they should be entered in the API URL.

Name Required Type Description
AgentID True numeric Unique idenfier of the agent.
Job.Created False date YYYY-MM-DD. Returns jobs that were created greater than or equal to the date specified.
Job.Started False date YYYY-MM-DD. Returns jobs that were started greater than or equal to the date specified.
Job.Ended False date YYYY-MM-DD. Returns jobs that ended less than or equal to the date specified.
Job.State False string Active, Archived, or All.

Responses

Name Type Description
Result string Success if the operation was successful.
Job Job Information about the jobs requested.

Sample request url

curl -X GET "https://api.mozenda.com/rest?WebServiceKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=Agent.GetJobs&AgentID=1001"

Sample responses

XML

<?xml version="1.0" encoding="utf-8"?>
<AgentGetJobsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Success</Result>
    <JobList>
        <Job>
            <ActiveJob>False</ActiveJob>
            <Created>2024-04-29 03:36:12</Created>
            <Modified>2024-04-29 04:32:19</Modified>
            <ItemSourceName>Mozenda-01</ItemSourceName>
            <JobID>20405</JobID>
            <Name>April 29, 2024, 3:36 AM</Name>
            <Description />
            <JobType>WebPageHarvest</JobType>
            <State>Done</State>
            <Status>Done</Status>
            <Duration>3343</Duration>
            <Command />
            <Start />
            <Started>2024-04-29 03:36:14</Started>
            <Ended>2024-04-29 04:32:19</Ended>
            <JobRestriction>mozenda.com</JobRestriction>
            <JobKey>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</JobKey>
            <ScheduleID>0</ScheduleID>
            <ScheduleItemType>WebPageHarvest</ScheduleItemType>
            <ScheduleItemID>1001</ScheduleItemID>
            <ErrorCode />
            <ErrorMessage />
            <ErrorDetail />
            <ErrorFirst />
            <ErrorLast />
            <ErrorCount />
            <WarningFirst>2024-04-29 03:36:29</WarningFirst>
            <WarningLast>2024-04-29 04:31:20</WarningLast>
            <WarningCount>14</WarningCount>
            <BatchID>20405</BatchID>
            <BatchOrder>1</BatchOrder>
            <SequenceID />
        </Job>
    </JobList>
</AgentGetJobsResponse>

JSON (add &ResponseFormat=JSON)

{
    "Job": [
        {
            "ActiveJob": false,
            "Created": "2024-04-29 03:36:12",
            "Modified": "2024-04-29 04:32:19",
            "ItemSourceName": "Mozenda-01",
            "JobID": 20405,
            "Name": "April 29, 2024, 3:36 AM",
            "Description": "",
            "JobType": "WebPageHarvest",
            "State": "Done",
            "Status": "Done",
            "Duration": "3343",
            "Command": "",
            "Start": "",
            "Started": "2024-04-29 03:36:14",
            "Ended": "2024-04-29 04:32:19",
            "JobRestriction": "mozenda.com",
            "JobKey": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
            "ScheduleID": "0",
            "ScheduleItemType": "WebPageHarvest",
            "ScheduleItemID": 1001,
            "ErrorCode": "",
            "ErrorMessage": "",
            "ErrorDetail": "",
            "ErrorFirst": "",
            "ErrorLast": "",
            "ErrorCount": "",
            "WarningFirst": "2024-04-29 03:36:29",
            "WarningLast": "2024-04-29 04:31:20",
            "WarningCount": "14",
            "BatchID": "20405",
            "BatchOrder": "1",
            "SequenceID": null
        },
        {
            "ActiveJob": false,
            "Created": "2024-04-16 09:08:03",
            "Modified": "2024-04-16 09:10:44",
            "ItemSourceName": "Mozenda-01",
            "JobID": 20399,
            "Name": "April 16, 2024, 9:08 AM",
            "Description": "",
            "JobType": "WebPageHarvest",
            "State": "Canceled",
            "Status": "Canceled",
            "Duration": "157",
            "Command": "",
            "Start": "",
            "Started": "2024-04-16 09:08:03",
            "Ended": "2024-04-16 09:10:44",
            "JobRestriction": "mozenda.com",
            "JobKey": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
            "ScheduleID": "0",
            "ScheduleItemType": "WebPageHarvest",
            "ScheduleItemID": 1001,
            "ErrorCode": "",
            "ErrorMessage": "",
            "ErrorDetail": "",
            "ErrorFirst": "",
            "ErrorLast": "",
            "ErrorCount": "",
            "WarningFirst": "2024-04-16 09:10:15",
            "WarningLast": "2024-04-16 09:10:15",
            "WarningCount": "1",
            "BatchID": "20399",
            "BatchOrder": "1",
            "SequenceID": null
        }
    ],
    "JsonResult": {
        "Command": "Agent.GetJobs",
        "AutoLoggedIn": false,
        "WebConsoleKey": "",
        "Result": "Success",
        "ErrorCode": "",
        "ErrorDescription": "",
        "ErrorList": []
    }
}