Agent.GetJobs
  • 25 May 2021
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Agent.GetJobs

  • Dark
    Light
  • PDF

Article Summary

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.

NameRequiredTypeDescription
AgentIDTruenumericUnique idenfier of the agent.
Job.CreatedFalsedateYYYY-MM-DD. Returns jobs that were created greater than or equal to the date specified.
Job.StartedFalsedateYYYY-MM-DD. Returns jobs that were started greater than or equal to the date specified.
Job.EndedFalsedateYYYY-MM-DD. Returns jobs that ended less than or equal to the date specified.
Job.StateFalsestringActive, Archived, or All.

Responses

NameTypeDescription
ResultstringSuccess if the operation was successful.
JobJobInformation 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=1039"

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>
			<Created>2008-11-13 16:41:26</Created>
			<Modified>2008-11-13 16:41:27</Modified>
			<JobID>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</JobID>
			<JobType>WebPageHarvest</JobType>
			<Status />
			<Started />
			<Ended />
			<AgentID>1002</AgentID>
			<ErrorCode />
			<ErrorMessage />
			<ErrorFirst />
			<ErrorLast />
			<ErrorCount />
			<WarningFirst />
			<WarningLast />
			<WarningCount />
		</Job>
	</JobList>
</AgentGetJobsResponse>

JSON (add &ResponseFormat=JSON)

{
  "Job": [
    {
      "ActiveJob": false,
      "Created": "2020-04-23 14:39:15",
      "Modified": "2020-04-23 15:39:39",
      "ItemSourceName": "Top100News",
      "JobID": 32474,
      "Name": "April 23, 2020, 2:39 PM",
      "Description": "",
      "JobType": "WebPageHarvest",
      "State": "Done",
      "Status": "Done",
      "Command": "",
      "Start": "",
      "Started": "2020-04-23 15:39:17",
      "Ended": "2020-04-23 15:39:39",
      "JobRestriction": "feedspot.com",
      "JobKey": "EE6246D0-1A76-4A64-8373-0B5A426F1FA1",
      "ScheduleID": "0",
      "ScheduleItemType": "WebPageHarvest",
      "ScheduleItemID": 1039,
      "ErrorCode": "",
      "ErrorMessage": "",
      "ErrorDetail": "",
      "ErrorFirst": "",
      "ErrorLast": "",
      "ErrorCount": "",
      "WarningFirst": "",
      "WarningLast": "",
      "WarningCount": "",
      "BatchID": "32474",
      "BatchOrder": "1",
      "SequenceID": null,
      "Duration": "22"
    },
    {
      "ActiveJob": false,
      "Created": "2020-02-27 14:58:10",
      "Modified": "2020-02-27 14:58:57",
      "ItemSourceName": "Top100News",
      "JobID": 32329,
      "Name": "February 27, 2020, 2:58 PM",
      "Description": "",
      "JobType": "WebPageHarvest",
      "State": "Done",
      "Status": "Done",
      "Command": "",
      "Start": "",
      "Started": "2020-02-27 14:58:22",
      "Ended": "2020-02-27 14:58:57",
      "JobRestriction": "feedspot.com",
      "JobKey": "D5FBB214-0520-405C-87FF-A259D99069A0",
      "ScheduleID": "0",
      "ScheduleItemType": "WebPageHarvest",
      "ScheduleItemID": 1039,
      "ErrorCode": "",
      "ErrorMessage": "",
      "ErrorDetail": "",
      "ErrorFirst": "",
      "ErrorLast": "",
      "ErrorCount": "",
      "WarningFirst": "",
      "WarningLast": "",
      "WarningCount": "",
      "BatchID": "32329",
      "BatchOrder": "1",
      "SequenceID": null,
      "Duration": "35"
    }
  ],
  "JsonResult": {
    "Command": "Agent.GetJobs",
    "AutoLoggedIn": false,
    "WebConsoleKey": "",
    "Result": "Success",
    "ErrorCode": "",
    "ErrorDescription": "",
    "ErrorList": [],
    "ExecutionTime": {
      "Ticks": 0,
      "Days": 0,
      "Hours": 0,
      "Milliseconds": 0,
      "Minutes": 0,
      "Seconds": 0,
      "TotalDays": 0,
      "TotalHours": 0,
      "TotalMilliseconds": 0,
      "TotalMinutes": 0,
      "TotalSeconds": 0
    }
  }
}

Was this article helpful?

What's Next