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
- In the TaskCentre client navigate to: System -> Tools -> Execute -> Double click on the Web Service Connector to open the global configuration.
- Click on the Add button to add a new connection.
- Provide a name for the connection, e.g. Mozenda. Select the last option “I do not have a definition file…” followed by OK.
- Enter the web service root as: https://api.mozenda.com/rest? (Do not interrogate the service as in this case nothing will be returned)
- Select the Operations tab and click Add to create a new operation.
- Provide a name for the operation, e.g. Agent_GetList.
- Select the URL tab and tick the box Use the connection URL.
In the lower text box enter:
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.
- 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.
- The response XML will now appear within the list box in the Output Data tab. Click Infer Schema from XML or JSON.
- This will generate a schema from the XML. Click Validate Schema to check that the schema is valid. Click OK to save this operation.
- 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.
- Create another operation, same as before. Provide a name and select POST as the operation type.
- Select the Input Document tab and select HTTP Query. Enter AgentID as a parameter name.
- Select the URL tab, tick the box Use the connection URL and in the text box at the bottom enter the following:
- 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.
- An output from this operation is the JobID which you will need for the next operation.
This operation gets the data generated by the run operation.
- Now add another operation as previously except at the beginning select GET as the operation type.
- Select the URL tab, select use the connection URL and enter
in the text box at the bottom.
- 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.
- 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.