Agent.Run - Mozenda

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

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Agent.Run&AgentID=1003&AgentParameter.Zip=90210&Job.StatusUrl=http%3A%2F%2Fmydomain.com%3FStatus%3D%25Job.Status%25%26JobID%3D%25JobID%25

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>

Need more information?

We'd love to hear from you.

100% Privacy. You are that important to us. Privacy Policy