Skip to content

Knowledge Base

White Paper Libary

Mozenda

Mozenda is an application that can read data from web pages (sometimes called screen scraping). Tasks can be built that run Mozenda and return the data to TaskCentre. Within TaskCentre you can create tasks which update your business application based on this data or trigger alerts or workflows.

After creating a Mozenda account (http://www.mozenda.com) you need to make the API accessible. There are instructions on making it accessible here https://www.mozenda.com/api. Follow the first five instructions and keep a note of the API Key generated.

Then go into the Mozenda client and set it up to read data from a specific website.

To get data back into TaskCentre you will need to set up three operations.

Agent_GetList – this just gives you the agent identity which you will need in the next step

Agent_Run – to run the Mozenda agent and refresh the data. This creates a Job ID which you use in the next step.

View_GetItems – to retrieve the data from the run

Agent_GetList setup

  1. In the TaskCentre client navigate to: System -> Tools -> Execute -> Double click on the Web Service Connector to open the global configuration.
    1
  2. Click on the Add button to add a new connection.
  3. Provide a name for the connection, e.g. Mozenda. Select the last option “I do not have a definition file…” followed by OK.
    2
  4. Enter the web service root as: https://api.mozenda.com/rest? (Do not interrogate the service as in this case nothing will be returned)
    3
  5. Select the Operations tab and click Add to create a new operation.
  6. Provide a name for the operation, e.g. Agent_GetList.
    4
  7. Select the URL tab and tick the box Use the connection URL.
    In the lower text box enter:
    WebServiceKey=yourAPIkey&Service=Mozenda10&Operation=Agent.GetList
    The first part up to Operation is always the same for all operations. Replace your API key with the API key that you generated at the beginning of this exercise.
    5
  8. Select the Output Data tab and click on Send Test Message. Click Test within the new dialog.
    This will call the service and re-display the response XML. The test dialog can now be closed.
  9. The response XML will now appear within the list box in the Output Data tab. Click Infer Schema from XML or JSON.
  10. This will generate a schema from the XML. Click Validate Schema to check that the schema is valid. Click OK to save this operation.
  11. Click the Test button again to test the operation and to return the XML once more. The XML will now contain the AgentID. Take a note of the ID as you will need it for the next operation. This first operation is not needed by tasks, it is only needed to locate the agent ID.
    6

Agent_Run setup

  1. Create another operation, same as before.  Provide a name and select POST as the operation type.
    7
  2. Select the Input Document tab and select HTTP Query. Enter AgentID as a parameter name.
    8
  3. Select the URL tab, tick the box Use the connection URL and in the text box at the bottom enter the following:
    WebServiceKey=yourAPIkey&Service=Mozenda10&Operation=Agent.Run
  4. Select the output data tab and repeat step 8 from the previous operation.This time when you test the service you will be prompted for the AgentID that was an output from the previous operation setup.
  5. An output from this operation is the JobID which you will need for the next operation.

View_GetItems setup

This operation gets the data generated by the run operation.

  1. Now add another operation as previously except at the beginning select GET as the operation type.
  2. Select the URL tab, select use the connection URL and enter
    WebServiceKey=yourAPIkey&Service=Mozenda10&Operation=View.GetItems&ViewID=1001&ViewParameter.JobID=yourJobID&PageNumber=1&PageItemCount=20
    in the text box at the bottom.
  3. You can either set values in step 2 for the PageNumber and PageItemCount or create parameters here to be used in the task step.You create parameters by entering a parameter name and dragging it into the URL to replace the explicit value. E.g.
    WebServiceKey=yourAPIkey&Service=Mozenda10&Operation=View.GetItems&ViewID=1001&ViewParameter.JobID=yourJobID&PageNumber={PageNumber}&PageItemCount=20
  4. Select the output data tab and repeat step 8 from the previous operation.This time when you test the service you will be prompted for the JobID that was an output from the previous operation setup.

You are now ready to build tasks that run the agent and get the data with the last two operations you have created.