Use API Parameters to Run an Agent - Mozenda Help Center
  • The Data You Want is Closer Than You Think

    Tell us about your data extraction needs.

  • Can‘t wait and need answers now?
    Here are other ways to reach us:

    +1 (801) 995-4550

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

Use API Parameters to Run an Agent

June 23, 2016

This walkthrough uses the Agent.Run API call to demonstrate how to pass parameters through an API call to an agent. These can be replicated for any API call.

To use Mozenda Rest API, you must first generate a web service key.

To begin, we recommend using a simple text editor such as Notepad so that you can see the entire URL on a single line.

  1. Copy and paste the first part of the API call into a text editor.
  2. Insert WebServiceKey= and your web service key (the one below is an example key).
  3. Insert &Service=Mozenda10&Operation= after the key.

  4. Insert the Agent.Run API call.


    As the name implies, the Agent.Run call will start a new job for the agent. Running this call will require the agent ID and any parameters built into the agent. For a full synopsis, see the Agent.Run API page.

  5. Enter &AgentID= after Agent.Run.

  6. Find the agent ID for the agent you want to run, and enter it after &AgentID=

    To find the agent ID, log in to the Web Console, go to the Agents tab, and look at the ItemID next to the agent you’d like to run.

  7. Identify one of the parameters in the agent.

    You may need to open the agent in the Agent Builder and look for any Set User Input actions with an input value that appears between two percent signs. It would look something like this: %ZipCode%

  8. Insert &AgentParameter. followed by the parameter name and value.


    Here’s what it looks like at the end of the API call:

  9. Repeat step 8 for any additional parameters in the agent.

    The completed API call should look something like this:


To test this API call, copy the API call you’ve assembled and paste it into a browser, then press Enter. Depending on the browser you choose, the response may be shown differently, but it should look something like this:

<AgentRunResponse xmlns:xsi="" xmlns:xsd="">

    <Result>Success</Result> indicates not that the agent has completed the job, but that the job has successfully started.