Agent.Run
August 10, 2015
Description
Starts a new job for an Agent
Required parameters
AgentID
Optional parameters
AgentParameter.<AgentParameterName>
(To learn more about how to set the parameters of an agent using the API, refer to this article in our Help Center.)
Job.Description
Job.Name
Job.StatusUrl – A URL that Mozenda will request when the job finishes processing.
The URL needs to begin with either the http:// or https:// protocol and needs to be URL encoded.
It can contain any of the following replacement values anywhere in the querystring. To include a replacement value, enclose it in percentage signs (e.g. %AgentID%).
- AgentID
- Agent.Name
- Agent.Description
- Agent.Domain
- JobID
- Job.Status
- Job.Created
- Job.Ended
- Job.Name
- Job.Description
Note: This URL may be executed multiple times during a job’s lifecycle, including the beginning and end. Use the most recently passed status when making decisions.
ReportRefresh.StatusUrl – A URL that Mozenda will request when the ReportRefreshData job finishes processing.
The URL needs to begin with either the http:// or https:// protocol and needs to be URL encoded.
It can contain any of the following replacement values anywhere in the querystring. To include a replacement value, enclose it in percentage signs (e.g. %AgentID%).
- AgentID
- Agent.Name
- Agent.Description
- Agent.Domain
- JobID
- Job.Status
- Job.Created
- Job.Ended
- Job.Name
- Job.Description
Note: This URL may be executed multiple times during a job’s lifecycle, including the beginning and end. Use the most recently passed status when making decisions.
Returns
The result of the operation and, if the request was successful, the JobID, JobType, and ReportRefreshJobID
Note: Publishing and view querying should be done once the ReportRefreshData job has completed. This can be verified with a Job.Get API request using the ReportRefreshJobID received in the Agent.Run result as the value for the JobID parameter.
Example request url
Example response
<?xml version="1.0" encoding="utf-8"?> <AgentRunResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Result>Success</Result> <AgentID>1003</AgentID> <JobID>15852</JobID> <JobType>WebPageHarvest</JobType> <ReportRefreshJobID>15853</ReportRefreshJobID> </AgentRunResponse>