801.995.4550 Free 30-Day Trial Login

Mozenda API

Using the Mozenda Web Services Rest API, customers can programmatically connect to their Mozenda account. This provides complete automation capabilities for setting search parameters, gathering results, updating collections, etc. This connection is made by sending a standard Http request that includes variables and other settings for interacting with the system. Configuring your account to be accessible via the API is a simple process: 1. Login to your account at http://account.mozenda.com/login 2. Click the Account link located in the top right corner of the web page. 3. Click the Users tab in the Account area. 4. Click the wrench symbol for the user you would like to configure an ‘API Web Service Key’ for. 5. Look for the ‘API Web Service Key’ section and then click Generate a New Key. You will be required to provide this key in all requests to the API. 6. Learn the syntax of the API requests using the documentation below and you are ready to go! After you have enabled your account for API access you will want to determine what functions you need to accomplish programmatically. Most of the actions you can perform via the Web Console can also be initiated through the API. Use the rest of this document as a reference for the different functions that you will need to perform.
With every API request there is some standard information that must be passed. First is the base url, which is:
https://api.mozenda.com/rest?

Next, each request made to the API requires your Web Service Key (described above) to authenticate your account. This value is passed in using the WebServiceKey parameter:
https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E

Next, each request needs to provide the Service parameter. This parameter specifies the version of the API being used. Right now the only accepted value is Mozenda10:
https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10

Finally, each request needs to provide the Operation parameter. This parameter tells the API what operation you want performed. A list of the available operations follows, along with a sample URL showing how to use the operation.
https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Agent.Run=1001

Optional: Each response to an API request is returned in XML format by default. Alternatively, an API response can be returned as JSON by specifying JSON for the value of the optional ResponseFormat parameter.
https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Agent.Run=1001&ResponseFormat=JSON

Important Note: All API requests must comply with the specification for URLs RFC 1738. This means some parameters need to be encoded before they are passed via the API. For Example, if you wanted to add a ViewParameter.Name parameter with the value of “Sport Camera” to your View.GetItems API call, then the correct encoding for this call is “ViewParameter.Name=Sport%20Camera”, because spaces are not allowed in URLs and should be replaced with a %20 in the encoding step of your process.

Collection.Add

Description

Adds an empty collection in your account.

Required parameters

Name

Optional parameters

Description

Returns

The result of the operation and the CollectionID if it was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F398&Service=Mozenda10&Operation=Collection.Add&Name=MyFirstCollection&Description=My%20description

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionAddResponse
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <CollectionID>2259</CollectionID>
 </CollectionAddResponse>
back to top

Collection.AddField

Description

Adds a field to the desired Collection. This field is created with the default format of “Text”. This operation can only be performed on Collections that are created by a user.

Required parameters

CollectionID, Name

Optional parameters

Description

Returns

The result of the operation and the FieldID if it was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F398&Service=Mozenda10&Operation=Collection.AddField&CollectionID=1052&Field=Col7&FieldDescription=My%20col7%20description

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionAddField
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <FieldID>2259</FieldID>
 </CollectionAddField>
back to top

Collection.AddItem

Description

Adds an item to a collection with the values specified. Instead of including the single item to be added in the request it is also possible to add items in bulk by attaching a file with the request.

Required parameters

CollectionID

Optional parameters

Field.<FieldName>,

Returns

The ItemID of the newly added item, or an error message stating why it could not be added.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.AddItem&CollectionID=1099&Field.FirstName=John&Field.LastName=Smith

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionAddItemResponse   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <ItemID>1098</ItemID>
</CollectionAddItemResponse>

Bulk Insertion

In addition to adding items one at a time, there is a method that can be used to add items in bulk. Below is some sample C# code that will demonstrate how this is done. This same technique can be used in many different programming languages to add multiple items to a Mozenda collection at one time. This option should be used whenever a large number of items need to be inserted all at once.
string webServiceKey = C70E1F84-E12B-4e73-B199-2EE6D43AF44E; //Your Account WebServiceKey.
string collectionID = 1001; //The ID of the destination Collection.
string url = string.Format(
"https://api.mozenda.com/rest?WebServiceKey={0}&Service=Mozenda10&Operation=Collection.AddItem&CollectionID={1}",
webServiceKey, collectionID);
string fileName = "C:\\Temp\\NewItems.xml"; //Path to the file containing the items to be uploaded.

WebClient client = new WebClient();
byte[] responseBinary = client.UploadFile(url, fileName);
string response = Encoding.UTF8.GetString(responseBinary);
The image below illustrates the format for each item in the uploaded file. XmlFormat
back to top

Collection.Clear

Description

Clears the contents of a collection but leaves the collection intact. WARNING: This operation is permanent!

Required parameter

CollectionID

Optional parameter

DeleteFilePackages (‘Yes’, ‘No’ – Yes to delete all file packages for the collection. Default is No)
RetainCollectionHistory (‘Yes’, ‘No’ – Yes to only mark items as deleted. Default is No)

Returns

A message indicating whether or not the command was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.Clear&CollectionID=1099

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionClearResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</CollectionClearResponse>
back to top

Collection.Delete

Description

Deletes the collection and all data within it. WARNING: This operation is permanent!

Required parameters

CollectionID

Returns

A message detailing whether or not the requested command was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.Delete&CollectionID=1009

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionDeleteResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</CollectionDeleteResponse>
back to top

Collection.DeleteField

Description

Deletes a field from the Collection. This operation can only be performed on Collections that are created by a user.

Required parameters

CollectionID, Field

Returns

A message detailing whether the delete field command executed successfully.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.DeleteField&CollectionID=1009&Field=ExampleFieldName

Example response

<?xml version="1.0" encoding="utf-8" ?>
<ApiResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</ApiResponse>
back to top

Collection.DeleteItem

Description

Deletes an item from a collection

Required parameters

CollectionID, ItemID

Returns

A message detailing whether the delete item command executed successfully.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.DeleteItem&CollectionID=1009&ItemID=1922

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionDeleteItemResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</CollectionDeleteItemResponse>
back to top

Collection.GetFields

Description

Returns a list of fields that are in that collection with their details

Required parameters

CollectionID

Optional parameter

Include (Can be set to All or Unique. It defaults to All.)

Returns

A list of fields for a collection.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.GetFields&CollectionID=1001&Include=Unique

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionGetFieldsResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <FieldList>
	 <Field>
		<FieldID>418</FieldID>
		<CollectionID>1003</CollectionID>
		<Name>ID</Name>
		<Description>Unique number identifying the Default.</Description>
		<IsSystem>True</IsSystem>
		<IsMatchUp>False</IsMatchUp>
	 </Field>
	 <Field>
		<FieldID>430</FieldID>
		<CollectionID>1003</CollectionID>
		<Name>AgentID</Name>
		<Description />
		<IsSystem>True</IsSystem>
		<IsMatchUp>False</IsMatchUp>
	 </Field>
  </FieldLists>
</CollectionGetFieldsResponse>
back to top

Collection.GetFile

Description

Downloads a file stored in a Collection.

Required parameters

CollectionID, ItemID, Field

Returns

Returns the raw bytes of the target file.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.GetFile&CollectionID=1001&ItemID=1002&Field=Picture

Example response

Collection.GetFile does not return a standard response when successful, it will instead return the raw bytes of the target file. Success Headers Example
Status: HTTP/1.1 200 OK
Cache-Control:	private
Content-Type:	application/octet-stream
Content-Disposition:	attachment; filename=1002-Picture.png
Date:	Tue, 27 Jun 2017 19:52:40 GMT	
Connection:	close
Content-Length:	3330
back to top

Collection.GetList

Description

Returns a list of collections for an account

Required parameters

None

Returns

A List of the collections in an account

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.GetList

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionGetListResponse
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <CollectionList>
	 <Collection>
		<CollectionID>1005</CollectionID>
		<Name>My First Collection</Name>
		<Description>Sample description of 'My 1st Collection'.</Description>
		<DefaultViewID>1003</DefaultViewID>
		<AgentID>1002</AgentID>
	 </Collection>
	 <Collection>
		<CollectionID>1067</CollectionID>
		<Name>ZipCodes</Name>
		<Description>Sample description of the 'ZipCodes' repository.</Description>
		<DefaultViewID>1036</DefaultViewID>
	 </Collection>
  </CollectionList>
</CollectionGetListResponse>
back to top

Collection.GetPublisher

Description

Returns a list of collections and their current publishing configuration.
Note: The PublishWhenAgentCompletes field will be removed if the collection is publishing on a schedule.

Required parameters

CollectionID or AgentID (comma separated lists)

Returns

A list of collections with their current publishing configuration.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.GetPublisher&CollectionID=1099&AgentID=1002

Example response

<?xml version="1.0" encoding="utf-8" ?>
<GetPublisherResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <Result>Success</Result>
 <CollectionList>
  <Collection>
	<CollectionName>Lowes</CollectionName>
	<CollectionID>1099</CollectionID>
	<AgentID>1001</AgentID>
	<PublishWhenAgentCompletes>1001</PublishWhenAgentCompletes>
	<Created>2012-01-01 10:50:45</Created>
	<CreatedBy>John</CreatedBy>
	<Description>Collection for Lowes</Description>
	<ViewID>1036</ViewID>
	<FileFormat>CSV</FileFormat>
	<FileName />
	<Method>Ftp</Method>   
	<IncludePackages>Yes</IncludePackages>	   
	<FtpServer>test.myserver.com</FtpServer>
	<FtpPort>21</FtpPort>
	<FtpDirectory />
	<FtpUser />
	<FtpPassword />
	<FtpUsePassive>Yes</FtpUsePassive>
	<FtpProtocol>SFTP</FtpProtocol>
  </Collection>
  <Collection>
	<CollectionName>Home Depot</CollectionName>
	<CollectionID>1100</CollectionID>
	<AgentID>1002</AgentID>
	<Created>2012-01-01 10:45:45</Created>
	<CreatedBy>John</CreatedBy>
	<Description>Collection for Home Depot</Description>
	<ViewID>1036</ViewID>
	<FileFormat>CSV</FileFormat>
	<FileName />
	<Method>Email</Method>
	<EmailAddress>john.doe@gmail.com<EmailAddress>
	<EmailSubject />		
  </Collection>
 </CollectionList>  
</GetPublisherResponse>
back to top

Collection.GetViews

Description

Gets a list of views for a particular collection

Required parameters

CollectionID

Returns

A list of the views that is currently in the system for a particular collection.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.GetViews&CollectionID=1008

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionGetViewsResponse
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <ViewList>
	 <View>
		<ViewID>801</ViewID>
		<CollectionID>801</CollectionID>
		<Name>All ZipCodes</Name>
		<Description>All items in the ZipCodes collection.</Description>
	 </View>
  </ViewList>
</CollectionGetViewsResponse>
back to top

Collection.Publish

Description

Publishes the collection according to the publishing information setup for the collection. Currently, this can be entered via the Web Console or using the Collection.SetPublisher call. For more information about configuring your collection for FTP publishing please click here.

Required parameters

CollectionID

Optional Parameters

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. %JobID%).
  • JobID
  • Job.Status
  • Job.Created
  • Job.Ended
Note: The status url may be requested multiple time for the Running status.

Returns

The result of the operation and the jobID if the request was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F398&Service=Mozenda10&Operation=Collection.Publish&CollectionID=1005

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionPublishResponse
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>  
  <JobID>EE64EC0E-F233-4549-8DF0-852298965F81</JobID>
 </CollectionPublishResponse>
back to top

Collection.SetPublisher

Description

Updates or creates a new publisher for the specified collection.

Required parameters

CollectionID, Method

Required parameters by Method

Email:
Method = “Email” EmailAddress = [email address]
FTP:
Method = “Ftp” FtpServer = [FTP server name]
AmazonS3:
Method = “AmazonS3” AmazonS3AuthenticationToken (AWS Access Key ID)
AmazonS3SignRequestToken (AWS Secret Access Key)
AmazonS3BucketPath
AmazonS3BucketRegion (The Amazon S3 endpoint for the selected bucket. Click here to see a list of valid endpoints)

AzureStorage:
Method = “AzureStorage” MicrosoftAzureStorageAccountName
MicrosoftAzureStorageAccountKey
MicrosoftAzureStorageContainerName

Dropbox:
Method = “Dropbox”

Google Drive:
Method = “Google”

Optional parameters

ViewID (An empty viewID is the default and will use “Everything” from the collection)
FileFormat (CSV, TSV, XML, JSON, and XLSX. Default is CSV)
FileName
FileIncludeHeader (‘Yes’, ‘No’ – Yes to add field headers to row one in the published file. Default is Yes.)
PublishWhenAgentCompletes (‘Yes’, ‘No’ – ‘Yes’ to publish when the Agent completes. ‘No’ to publish manually. When not specified, no change is made unless initializing a new publisher which defaults to ‘No’.)
ItemStatusIncludeColumn (‘Yes’, ‘No’ – ‘Yes’ to include the column in the data file. Default is No)

Optional parameters for ItemStatusInclude

ItemStatusIncludeAdded (‘Yes’, ‘No’)
ItemStatusIncludeChanged (‘Yes’, ‘No’)
ItemStatusIncludeUnchanged (‘Yes’, ‘No’)
ItemStatusIncludeDeleted (‘Yes’, ‘No’)
Note: These item status filtering options have no effect unless ItemStatusIncludeColumn is true.

Optional parameters by Method

Email:
EmailSubject
FTP:
FtpPort (Default is 21),
FtpProtocol (FTP, SFTP. Default is FTP),
FtpDirectory,
FtpUser,
FtpPassword,
FtpUsePassive (‘Yes’, ‘No’. Yes to use passive transfer mode. Default is Yes.),
IncludePackages (‘Yes’, ‘No’. Yes to include images/files when publishing to FTP. Default is No.)

Dropbox:
DropBoxFolder (use a file path beginning with the first sub-folder, for example: Mozenda/DataFeeds/Agent1)

Google Drive:
GoogleFolder (use a file path beginning with the first sub-folder, for example: Mozenda/DataFeeds/Agent1)

Returns

Returns a message specifying whether or not the add/update was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.SetPublisher&CollectionID=1099&Method=Email&EmailAddress=MyEmail@Provider.com

Example response

<?xml version="1.0" encoding="utf-8" ?>
<SetPublisherResponse
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Result>Success</Result>
</SetPublisherResponse>

Additional Information

  • A publisher cannot be created with a Method of “None”, it must be FTP, Email, AmazonS3, Azure, Dropbox, or Google.
  • A publisher will only update the fields related to your Method (i.e – If Method is Ftp, only the common optional fields and the Ftp fields will be updated).
  • If you are creating a new publisher any fields you don’t provide (that are not required) will be set to default values.
  • If you have manually setup a schedule for your publisher in the web console’s publish dialog, then do not provide the ‘PublishWhenAgentCompletes’ parameter or the schedule will be deleted.
back to top

Collection.SetUniqueFields

Description

Sets the Unique Fields on the Collection. WARNING: This operation will delete any duplicates in the collection based on the new unique fields being set.

Required parameters

CollectionID, Fields (comma-separated list of field names to be set as unique)

Returns

A message detailing whether the command executed successfully and also the number of duplicate items removed.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F377&Service=Mozenda10&Operation=Collection.SetUniqueFields&Fields=Col1,Col2,Col3&CollectionID=1052

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionSetUniqueFieldsResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
  <DuplicateItemsRemoved>0</DuplicateItemsRemoved>
</CollectionSetUniqueFieldsResponse>
back to top

Collection.UpdateField

Description

Modifies a field in a collection.

Required parameters

FieldID

Optional parameters

Description, Format (currently supported options are Text, File, and DateTime), Name

Returns

Returns a message specifying whether or not the update was successful

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.UpdateField&CollectionID=1008&FieldID=1098&Name=MyNewFieldName&Description=My%20new%20field%20description&Format=File

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionUpdateFieldResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</CollectionUpdateFieldResponse>
back to top

Collection.UpdateItem

Description

Updates an item in the collection.

Required parameters

CollectionID, ItemID

Optional parameters

Field.<FieldName>

Returns

Returns a message specifying whether or not the update was successful

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Collection.UpdateItem&CollectionID=1008&ItemID=1098&Field.FirstName=Harry&Field.LastName=Johnson&Field.Age=27

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionUpdateItemResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</CollectionUpdateItemResponse>
back to top

View.Add

Description

Adds a view to a collection.

Required parameters

Name CollectionID

Optional Parameters

Description

Returns

Message specifying whether or not the view was successfully created.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F377&Service=Mozenda10&Operation=View.Add&CollectionID=1091&Name=RetailStores

Example response

<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <ViewID>1102</ViewID>
</ApiResponse>
back to top

View.AddCriteria

Description

Adds a criteria item to a view.

Required parameters

ViewID Operator (Contains, Equals, EndsWith, DoesNotContain, etc.) FieldName Value (Note: Value is not required for some operators, such as ‘Is After Today’ and ‘Is Empty’)

Optional Parameters

AndOr (valid options are And’, ‘Or’, and ‘None’. Default is None)

Returns

Message specifying whether or not the criteria was successfully added to the view.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F377&Service=Mozenda10&Operation=View.AddCriteria&ViewID=1103&Operator=Contains&FieldName=Price&Value=2

Example response

<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
</ApiResponse>

Valid Operators by Field Type

Text Field Equals Does Not Equal Contains Does Not Contain Is Empty Is Not Empty Begins With Does Not Begin With Ends With Does Not End With DateTime Field Equals Does Not Equal Is Today Is After Is After Now Is After Today Is Before Is Before Now Is Before Today Is Empty Is Not Empty Number Field Equals Does Not Equal Is Greater Than Is Less Than Is Greater Than Or Equal Is Less Than Or Equal Is Empty Is Not Empty
back to top

View.ClearCriteria

Description

Clears the criteria on the view.

Required parameters

ViewID

Returns

Message specifying whether or not the criteria was successfully cleared from the view.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F377&Service=Mozenda10&Operation=View.ClearCriteria&ViewID=1102

Example response

<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
</ApiResponse>
back to top

View.Delete

Description

Deletes the view. WARNING: This operation is permanent!

Required parameters

ViewID

Returns

Message specifying whether or not the view was successfully deleted.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F377&Service=Mozenda10&Operation=View.Delete&ViewID=1102

Example response

<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
</ApiResponse>
back to top

View.DeleteItems

Description

Deletes all the items in the View. WARNING: This operation is permanent!

Required parameters

ViewID

Returns

A message detailing whether or not the requested command was successful and the number of items that have been deleted.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=View.DeleteItems&ViewID=1009

Example response

<?xml version="1.0" encoding="utf-8" ?>
<ViewDeleteItemsResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <ItemsDeleted>67</ItemsDeleted> 
</ViewDeleteItemsResponse>
back to top

View.GetCriteria

Description

Returns a list of criteria currently specified on the view.

Required parameters

ViewID

Returns

A list of criteria and corresponding attributes (FieldID, ViewCriteriaID, Operator, etc.).

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F377&Service=Mozenda10&Operation=View.GetCriteria&ViewID=1103

Example response

<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <CriteriaList>
    <Criteria>
      <FieldID>3402</FieldID>
      <ViewCriteriaID>1100</ViewCriteriaID>
      <ComparisonOrder>1</ComparisonOrder>
      <AndOr/>
      <Operator>EndsWith</Operator>
      <ComparisonValue>.</ComparisonValue>
      <Name>Name</Name>
    </Criteria>
  </CriteriaList>
</ApiResponse>
back to top

View.GetItems

Description

Returns items from a view. To learn how to setup a view for a collection click here.

Required parameters

ViewID

Conditional parameters

CollectionID – Required if the view is a shared view in an agent group.

Optional parameters

ItemStatusIncludeColumn (‘Yes’, ‘No’ – Yes to include the column in the data file. Default is No)
PageNumber
PageItemCount
ViewParameter.JobID
ViewParameter.<ViewParameterName>

Optional parameters for ItemStatusInclude

ItemStatusIncludeAdded (‘Yes’, ‘No’)
ItemStatusIncludeChanged (‘Yes’, ‘No’)
ItemStatusIncludeUnchanged (‘Yes’, ‘No’)
ItemStatusIncludeDeleted (‘Yes’, ‘No’)
ItemStatusRangeStart (YYYY-MM-DD HH:mm:ss – The beginning date to calculate the items that should be included with the view.)
ItemStatusRangeEnd (YYYY-MM-DD HH:mm:ss – The ending date to calculate the items that should be included with the view.)
Note: These item status filtering options have no effect unless ItemStatusIncludeColumn is true. See the Additional Information section below for usage.

Returns

The number of items that were requested according to the PageItemCount parameter
Note: A maximum of 1,000 items will be returned even if the specified PageItemCount parameter is greater than 1,000.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=View.GetItems&ViewID=1022&ViewParameter.JobID=04E2DA-DF22-4239-A343-DE685AF54EC6&PageNumber=1&PageItemCount=20&ViewParameter.Name=Michael

Example response

<?xml version="1.0" encoding="utf-8" ?>
<ViewGetItemsResponse
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Result>Success</Result>
	<PageItemCount>2</PageItemCount>
	<PageNumber>2</PageNumber>
	<PageCount>106</PageCount>
	<ItemList>
		<Item>
			<ItemID>1092</ItemID>
			<Year>2000</Year>
			<Make>BMW</Make>
			<Model>328CI</Model>
			<Price>$7490</Price>
			<Telephone>4049141131</Telephone>
			<AreaCode>404</AreaCode>
			<Source>A1Cars</Source>
		</Item>
		<Item>
			<ItemID>1103</ItemID>
			<Year>2003</Year>
			<Make>BMW</Make>
			<Model>525i</Model>
			<Price>$14850</Price>
			<Telephone>8606342015</Telephone>
			<AreaCode>860</AreaCode>
			<Source>A1Cars</Source>
		</Item>
	</ItemList>
</ViewGetItemsResponse>

Additional Information

ItemStatusInclude options
  • If any item status filtering options are set to true, the results will only include items with those statuses.
  • If no item status filtering option is set to true, and any are set to false, the results will include items with all statuses not set to false.
  • Finally, if no item status filtering options are set at all, the results will include items with statuses of Added, Changed, and UnChanged, but not Deleted.
ItemStatusRange options
  • If the ItemStatusRangeStart and ItemStatusRangeEnd values are not provided, the system uses the start and end times of the supplied JobID.
  • If no JobID is supplied, the system will get this range from the most recently created job for this Agent.
back to top

View.GetSorting

Description

Returns the current sorting configuration for the view.

Required parameters

ViewID

Returns

Sorting details (ViewSortID, FieldID, IsAscending) for the specified view. Will include multiple results if more than one sorting method is used.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F377&Service=Mozenda10&Operation=View.GetSorting&ViewID=1103

Example response

<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <SortList>
    <Sort>
      <ViewSortID>1015</ViewSortID>
      <FieldID>3405</FieldID>
      <IsAscending>True</IsAscending>
    </Sort>
  </SortList>
</ApiResponse>
back to top

View.SetFields

Description

Sets the fields that are included in the view and also their order. To setup a view for a collection click here

Required parameters

ViewID, Fields (Comma-separated list of field names to be included in the view)

Returns

The result of the operation.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F377&Service=Mozenda10&Operation=View.SetFields&Fields=Col6,Col5,Col4&ViewID=1054

Example response

<?xml version="1.0" encoding="utf-8" ?>
<ViewSetFieldsResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</ViewSetFieldsResponse>
back to top

View.SetSorting

Description

Sets the sorting configuration for the view. WARNING: Setting a new sorting method will replace any existing rules for sorting, not add to them.

Required parameters

ViewID, Fields (comma-separated; sort method defaults to ascending unless ” desc” is specified, see example below)

Returns

Message specifying whether or not the sorting was successfully set.

Example request url

https://api.mozenda.com/rest?WebServiceKey=3FE7221C-9097-4B64-AED6-0950F675F377&Service=Mozenda10&Operation=View.SetSorting&ViewID=1103&Fields=Model desc,Name

Example response

<ApiResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
</ApiResponse>
back to top

Agent.Add

Description

Adds a new Agent. Cannot be used to overwrite an existing Agent. The existing Agent must be deleted first using the Agent.Delete request.

Required parameters

Name, Definition (Needs to be attached as a file)

Optional parameters

Description
BrowserIsolation (‘Yes’, ‘No’ – Yes to run the Agent with isolated browsers. Default is No)

Returns

The AgentID and CollectionID for the new Agent if the request was successful.

Example request

string agentDefinitionfileName = @"C:\Temp\AgentDefinition.xml"; //Path to the Agent definition file to be uploaded.
string url = @"https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Agent.Add&Name=MyTestAgent";

WebClient client = new WebClient();
byte[] responseBinary = client.UploadFile(url, agentDefinitionfileName);
string response = Encoding.UTF8.GetString(responseBinary);	

Example response

<?xml version="1.0" encoding="utf-8" ?>
<AgentSaveResponse
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Result>Success</Result>
	<AgentID>1009</AgentID>
	<CollectionID>1009</CollectionID>
</AgentSaveResponse>
back to top

Agent.Delete

Description

Deletes an agent and all associated schedules for that agent.

Required parameters

AgentID

Returns

A confirmation message describing whether or not the request was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Agent.Delete&AgentID=1008

Example response

<?xml version="1.0" encoding="utf-8" ?>
<AgentDeleteResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</AgentDeleteResponse>
back to top

Agent.Get

Description

Gets the Agent definition and meta data for an Agent.

Required parameters

AgentID

Returns

A response containing the AgentID, Name, CollectionID, Description, Domain, and Definition for an Agent.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Agent.Get&AgentID=1005

Example response

<?xml version="1.0" encoding="utf-8" ?>
<AgentGetResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>  
	<AgentID>1005</AgentID>
	<Name>My First Agent</Name>
	<CollectionID>1005</CollectionID>
	<Description>Extracts new lead information</Description>
	<Domain>myleadwebsite.com</Domain>
	<Definition>
<![CDATA[<!-- Copyright (C) 2015 Mozenda, Inc. All rights reserved. -->

<Agent>
  <Version>1.0i</Version>
  <IeVersion>8.0</IeVersion>
  <AgentDefinition>

	 <!--- - - - - - - - Actions - - - - - - - - -->

	 <ActionList>

		<Action>
		  <ActionType>LoadPage</ActionType>
		  <Page>0</Page>
		  <DestinationPage>1</DestinationPage>
		  <TopLevelNav>True</TopLevelNav>
		  <TopLevelNavCount>1</TopLevelNavCount>
		  <PageUrl>https://www.mozenda.com/builderwelcome</PageUrl>
		</Action>

		<!-- Page 1 -->

		<Action>
		  <ActionType>PagePlaceHolder</ActionType>
		  <Page>1</Page>
		  <ItemType>PlaceHolder</ItemType>
		  <LoadUrl>https://www.mozenda.com/builderwelcome</LoadUrl>
		  <BaseUrl>https://www.mozenda.com/builderwelcome</BaseUrl>
		  <CaptureScreenShot>False</CaptureScreenShot>
		  <NonScrollingScreenShot>False</NonScrollingScreenShot>
		</Action>

		<Action>
		  <ActionType>BeginAnchorList</ActionType>
		  <Page>1</Page>
		  <ItemType>PlaceHolder</ItemType>
		  <ItemXPath>//div[1]/div[2]/div/div/h3[1]/a[1]</ItemXPath>
		  <ItemXPath>/html[1]/body[1]/div[1]/div[1]/div[2]/div/div/h3[1]/a[1]</ItemXPath>
		  <ListName>LeadNameList</ListName>
		</Action>

		<Action>
		  <ActionType>GetElementValue</ActionType>
		  <Description>Captures the text of the list item</Description>
		  <Page>1</Page>
		  <ItemType>PlaceHolder</ItemType>
		  <ItemXPath>.</ItemXPath>
		  <FieldExpression>%LeadName%</FieldExpression>
		</Action>

		<Action>
		  <ActionType>GetElementValue</ActionType>
		  <Page>1</Page>
		  <ItemType>PlaceHolder</ItemType>
		  <ItemXPath>../..</ItemXPath>
		  <FieldExpression>%ContactEmail%</FieldExpression>
		</Action>

		<Action>
		  <ActionType>EndList</ActionType>
		  <Page>1</Page>
		  <ListName>LeadNameList</ListName>
		</Action>

	 </ActionList>

  </AgentDefinition>
</Agent>]]>
</Definition>
	
</AgentGetResponse>
back to top

Agent.GetCombinedCollections

Description

Returns a list of Agents and the combined collections they source.

Required parameters

AgentID (comma separated list)

Returns

A list of Agents and the combined collections they source.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Agent.GetCombinedCollections&AgentID=1001,1002

Example response

<?xml version="1.0" encoding="utf-8" ?>
<AgentGetCombinedCollectionsResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <AgentList>
	 <Agent>            
		<AgentID>1001</AgentID>            
		<SourcesCollections>1145</SourcesCollections>      
	 </Agent>
	 <Agent>            
		<AgentID>1002</AgentID>            
		<SourcesCollections>1145,1146</SourcesCollections>      
	 </Agent>
  </AgentList>
</AgentGetCombinedCollectionsResponse>
back to top

Agent.GetJobs

Description

Returns a list of your agent’s jobs with detailed information.

Required parameters

AgentID

Optional parameters

Job.Created (YYYY-MM-DD. Returns jobs that were created greater than or equal to the date specified)
Job.Started (YYYY-MM-DD. Returns jobs that were started greater than or equal to the date specified)
Job.Ended (YYYY-MM-DD. Returns jobs that ended less than or equal to the date specified)
Job.State (Active, Archived, All)

Returns

A list of current jobs in the system for this agent in descending order.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Agent.GetJobs&AgentID=1001&Job.Started=2009-02-06&Job.Ended=2009-02-07&Job.State=Active

Example response

<?xml version="1.0" encoding="utf-8" ?>
<AgentGetJobsResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <JobList>
	 <Job>
		<Created>2008-11-13 16:41:26</Created>
		<Modified>2008-11-13 16:41:27</Modified>
		<JobID>EE64EC0E-F233-4549-8DF0-852298965F81</JobID>
		<JobType>WebPageHarvest</JobType>
		<Status />
		<Started />
		<Ended />
		<AgentID>1002</AgentID>
		<ErrorCode />
		<ErrorMessage />
		<ErrorFirst />
		<ErrorLast />
		<ErrorCount />
		<WarningFirst />
		<WarningLast />
		<WarningCount />
	 </Job>
  </JobList>
</AgentGetJobsResponse>
back to top

Agent.GetList

Description

Returns a list of your agents with their ID, Name, Settings, Description, and other important information.

Required parameters

None

Optional parameters

IncludeStartingURL (true or false)

Returns

A list of agents for an account.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Agent.GetList

Example response

<?xml version="1.0" encoding="utf-8" ?>
<AgentGetListResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <AgentList>
	 <Agent>
		<Created>2008-06-21 08:45:32</Created>
		<Modified />
		<AgentID>1001</AgentID>
		<Name>My First Agent</Name>
		<Description>This is my first agent</Description>
		<Settings />
		<StartingURL>https://mozenda.com/builderwelcome</StartingURL>
	 </Agent>
	 <Agent>
		<Created>2008-06-23 14:20:49</Created>
		<Modified />
		<AgentID>1003</AgentID>
		<Name>Scraped Data</Name>
		<Description />
		<Settings />
		<StartingURL>https://mozenda.com/builderwelcome</StartingURL>
	 </Agent>
  </AgentList>
</AgentGetListResponse>
back to top

Agent.Run

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>
back to top

Job.Cancel

Description

Cancels a Job in the system.
Note: A job must be in a Paused or Error State to cancel a job

Required parameters

JobID

Returns

A message indicating whether the command was successful

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Job.Cancel&JobID=EE64EC0E-F233-4549-8DF0-852298965F81

Example response

<?xml version="1.0" encoding="utf-8" ?>
<JobCancelResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</JobCancelResponse>
back to top

Job.Get

Description

Gets the details of a job by the Job ID.

Required parameters

JobID (comma-separated list of JobID’s)

Optional parameters

IncludeJobStatistics (‘Yes’, ‘No’ – Yes to include job statistics. Default is No)

Returns

A response containing the Status, Command, CreatedDate, CreatedBy, AccountID, AgentID, and ErrorMessage of a particular job in the system.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Job.Get&JobID=EE64EC0E-F233-4549-8DF0-852298965F81

Example response

<?xml version="1.0" encoding="utf-8" ?>
<JobGetResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <Job>
	 <ActiveJob>True</ActiveJob>
	 <JobID>EE64EC0E-F233-4549-8DF0-852298965F81</JobID>
	 <JobType>WebPageHarvest</JobType>
	 <Created>2008-11-05 17:04:36</Created>
	 <Modified>2008-11-14 13:20:19</Modified>
	 <Status>Running</Status>
	 <Started />
	 <Ended />
	 <ScheduleID />
	 <ScheduleItemType>WebPageHarvest</ScheduleItemType>
	 <ScheduleItemID>1001</ScheduleItemID>
	 <ErrorCode />
	 <ErrorMessage />
	 <ErrorFirst />
	 <ErrorLast />
	 <ErrorCount />
	 <WarningFirst />
	 <WarningLast />
	 <WarningCount />
  </Job>
</JobGetResponse>
back to top

Job.GetAgentProgress

Description

Gets the progress of the Agent.

Required parameters

JobID

Returns

A response containing the progress of each list in the Agent. If there are DataLists then it will return the currently processing item from the view.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Job.GetAgentProgress&JobID=EE64EC0E-F233-4549-8DF0-852298965F81

Example response

<?xml version="1.0" encoding="utf-8" ?>
<JobGetAgentProgressResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <AgentID>1029</AgentID>
  <JobID>1B869E2F-06CA-48D4-B7D9-CECC7DE28DA6</JobID>
  <BeginListList>
	<BeginList>
	 <ListName>ForumTitleList</ActiveJob>
	 <AgentPage>1</AgentPage>
	 <Type>BeginAnchorList</Type>
	 <RestartItemIndex>5</RestartItemIndex>
	</BeginList>
  </BeginListList>
</JobGetAgentProgressResponse>
back to top

Job.GetList

Description

Gets all the active jobs for the account.

Required parameters

None

Optional parameters

Job.Created (YYYY-MM-DD. Returns jobs that were created greater than or equal to the date specified)
Job.Started (YYYY-MM-DD. Returns jobs that were started greater than or equal to the date specified)
Job.Ended (YYYY-MM-DD. Returns jobs that ended less than or equal to the date specified)
Job.State (All, Active, Archived)

Returns

A response containing the Status, Command, CreatedDate, CreatedBy, AccountID, AgentID, and ErrorMessage of all jobs for a particular account in the system.

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Job.GetList&Job.State=Archived

Example response

<?xml version="1.0" encoding="utf-8" ?>
<JobGetResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <JobCount>10</JobCount>
  <JobList>
	<Job>
	 <ActiveJob>True</ActiveJob>
	 <JobID>EE64EC0E-F233-4549-8DF0-852298965F81</JobID>
	 <JobType>WebPageHarvest</JobType>
	 <Created>2008-11-05 17:04:36</Created>
	 <Modified>2008-11-14 13:20:19</Modified>
	 <Status>Running</Status>
	 <Started />
	 <Ended />
	 <ScheduleID />
	 <ScheduleItemType>WebPageHarvest</ScheduleItemType>
	 <ScheduleItemID>1001</ScheduleItemID>
	 <ErrorCode />
	 <ErrorMessage />
	 <ErrorFirst />
	 <ErrorLast />
	 <ErrorCount />
	 <WarningFirst />
	 <WarningLast />
	 <WarningCount />
	</Job>
	<Job>
	 <ActiveJob>True</ActiveJob>
	 <JobID>FF64EC0E-F233-4549-8DF0-852298965F82</JobID>
	 <JobType>WebPageHarvest</JobType>
	 <Created>2008-11-06 16:04:36</Created>
	 <Modified>2008-11-14 14:20:19</Modified>
	 <Status>Running</Status>
	 <Started />
	 <Ended />
	 <ScheduleID />
	 <ScheduleItemType>WebPageHarvest</ScheduleItemType>
	 <ScheduleItemID>1002</ScheduleItemID>
	 <ErrorCode />
	 <ErrorMessage />
	 <ErrorFirst />
	 <ErrorLast />
	 <ErrorCount />
	 <WarningFirst />
	 <WarningLast />
	 <WarningCount />
	</Job>
  </JobList>
</JobGetResponse>
back to top

Job.Pause

Description

Issues the ‘Pause’ command for a job currently running in the system

Required parameters

JobID

Returns

A message indicating whether the command was successful

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Job.Pause&JobID=EE64EC0E-F233-4549-8DF0-852298965F81

Example response

<?xml version="1.0" encoding="utf-8" ?>
<JobPauseResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</JobPauseResponse>
back to top

Job.Resume

Description

Resumes a job that is in a Paused or Error state.

Required parameters

JobID

Returns

A message indicating whether the command was successful

Example request url

https://api.mozenda.com/rest?WebServiceKey=C70E1F84-E12B-4e73-B199-2EE6D43AF44E&Service=Mozenda10&Operation=Job.Resume&JobID=EE64EC0E-F233-4549-8DF0-852298965F81

Example response

<?xml version="1.0" encoding="utf-8" ?>
<JobResumeResponse 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result> 
</JobResumeResponse>
back to top

Sequence.AddStepParameters

Description

Adds one or more parameters to a step.

Required parameters

SequenceStepID , One or more parameters that you want to add to the step with their values. Use the format StepParameter.<ParamName>=<Value>.
Note: A Sequence.GetStatus API call can be used to quickly get the SequenceStepID.

Returns

A message indicating whether the command was successful successfull.

Example request url

https://api.mozenda.com/rest?WebServiceKey=A0D9167A-2E68-42EA-BB51-9F7EBDB4EE33&Service=Mozenda10&Operation=Sequence.AddStepParameters&SequenceStepID=1001&StepParameter.SearchTerm=DSLR

Example response

<?xml version="1.0" encoding="utf-8"?>
<AddStepParametersResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Success</Result>
</AddStepParametersResponse>

Note: Please contact your sales representative at +1 (801) 995-4550 or sales@mozenda.com for more information about enabling Sequences on your account.
back to top

Sequence.Cancel

Description

Cancels a sequence in the system.
Note: A sequence must be in a Paused or Error State to cancel.

Required parameters

SequenceID

Returns

A message indicating whether the command was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=7BA008DF-6B13-492C-97E6-1B1042D1DC02&Service=Mozenda10&Operation=Sequence.Cancel&SequenceID=1001

Example response

<?xml version="1.0" encoding="utf-8"?>
<SequenceCancelResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Success</Result>
</SequenceCancelResponse>

Note: Please contact your sales representative at +1 (801) 995-4550 or sales@mozenda.com for more information about enabling Sequences on your account.
back to top

Sequence.ClearStepParameters

Description

Clear all the parameters for a step.

Required parameters

SequenceStepID
Note: A Sequence.GetStatus API call can be used to quickly get the SequenceStepID.

Returns

A message indicating whether the command was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=A0D9167A-2E68-42EA-BB51-9F7EBDB4EE33&Service=Mozenda10&Operation=Sequence.ClearStepParameters&SequenceStepID=1001

Example response

<?xml version="1.0" encoding="utf-8"?>
<ClearStepParametersResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Success</Result>
</ClearStepParametersResponse>

Note: Please contact your sales representative at +1 (801) 995-4550 or sales@mozenda.com for more information about enabling Sequences on your account.
back to top

Sequence.GetList

Description

Get a list of sequences for the account.

Required parameters

None

Returns

A response containing the ItemID, Name, Status, Config, Progress, NextRunTime, LastRunTime, and LastRunResult for each sequence.

Example request url

https://testapp.mozenda.com/rest?WebServiceKey=7BA008DF-6B13-492C-97E6-1B1042D1DC02&Service=Mozenda10&Operation=Sequence.GetList

Example response

<?xml version="1.0" encoding="utf-8"?>
<SequenceGetListResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Success</Result>
    <SequenceCount>2</SequenceCount>
    <SequencesList>
        <Sequences>
            <ItemID>1001</ItemID>
            <Name>Beginning Of Day</Name>
            <Status>Running</Status>
            <Config>agentrun publishdata</Config>
            <Progress>AgentRun,1001,Products</Progress>
            <NextRunTime />
            <LastRunTime>2017-09-20 21:04:03</LastRunTime>
            <LastRunResult>Done</LastRunResult>
        </Sequences>
        <Sequences>
            <ItemID>1002</ItemID>
            <Name>Weekly Clear</Name>
            <Status>Ready</Status>
            <Config>collectionclear publishdata</Config>
            <Progress />
            <NextRunTime />
            <LastRunTime />
            <LastRunResult />
        </Sequences>
    </SequencesList>
</SequenceGetListResponse>

Note: Please contact your sales representative at +1 (801) 995-4550 or sales@mozenda.com for more information about enabling Sequences on your account.
back to top

Sequence.GetStatus

Description

Gets the status of each step for a given sequence.

Required parameters

SequenceID

Returns

A response containing the ItemID, StepNumber, Step, Config, Status, Progress, StepType, StepItemID, Settings, ConcurrentJobs, ResumeErrorCount, and ResumeErrorCodes for each step in the sequence.

Example request url

https://api.mozenda.com/rest?WebServiceKey=7BA008DF-6B13-492C-97E6-1B1042D1DC02&Service=Mozenda10&Operation=Sequence.GetStatus&SequenceID=1001

Example response

<?xml version="1.0" encoding="utf-8"?>
<SequenceGetStatusResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Success</Result>
    <StepList>
        <Step>
            <ItemID>1001</ItemID>
            <StepNumber>1</StepNumber>
            <Step>Run Products</Step>
            <Config />
            <Status>Ready</Status>
            <Progress />
            <StepType>AgentRun</StepType>
            <StepItemID>1036</StepItemID>
            <Settings />
            <ConcurrentJobs>1</ConcurrentJobs>
            <ResumeErrorCount>0</ResumeErrorCount>
            <ResumeErrorCodes />
        </Step>
        <Step>
            <ItemID>1002</ItemID>
            <StepNumber>2</StepNumber>
            <Step>Publish Products</Step>
            <Config>PublishEmail</Config>
            <Status>Ready</Status>
            <Progress />
            <StepType>PublishData</StepType>
            <StepItemID>1016</StepItemID>
            <Settings />
            <ConcurrentJobs>0</ConcurrentJobs>
            <ResumeErrorCount>0</ResumeErrorCount>
            <ResumeErrorCodes />
        </Step>
    </StepList>
</SequenceGetStatusResponse>

Note: Please contact your sales representative at +1 (801) 995-4550 or sales@mozenda.com for more information about enabling Sequences on your account.
back to top

Sequence.GetStepParameters

Description

Get the currently configured step parameters.

Required parameters

SequenceStepID
Note: A Sequence.GetStatus API call can be used to quickly get the SequenceStepID.

Returns

A response containing the names and values of each parameter associated with the step.

Example request url

https://api.mozenda.com/rest?WebServiceKey=A0D9167A-2E68-42EA-BB51-9F7EBDB4EE33&Service=Mozenda10&Operation=Sequence.GetStepParameters&SequenceStepID=1001

Example response

<?xml version="1.0" encoding="utf-8"?>
<GetStepParametersResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Success</Result>
    <StepParameterList>
        <StepParameter>
            <Name>URL</Name>
            <Value>https://www.mozenda.com/api</Value>
        </StepParameter>
    </StepParameterList>
</GetStepParametersResponse>

Note: Please contact your sales representative at +1 (801) 995-4550 or sales@mozenda.com for more information about enabling Sequences on your account.
back to top

Sequence.Pause

Description

Issues the ‘Pause’ command for a sequence currently running in the system.

Required parameters

SequenceID

Returns

A message indicating whether the command was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=7BA008DF-6B13-492C-97E6-1B1042D1DC02&Service=Mozenda10&Operation=Sequence.Pause&SequenceID=1001

Example response

<?xml version="1.0" encoding="utf-8"?>
<SequencePauseResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Success</Result>
</SequencePauseResponse>

Note: Please contact your sales representative at +1 (801) 995-4550 or sales@mozenda.com for more information about enabling Sequences on your account.
back to top

Sequence.Resume

Description

Resumes a sequence that is in a Paused or Error state.

Required parameters

SequenceID

Returns

A message indicating whether the command was successful.

Example request url

https://api.mozenda.com/rest?WebServiceKey=7BA008DF-6B13-492C-97E6-1B1042D1DC02&Service=Mozenda10&Operation=Sequence.Resume&SequenceID=1001

Example response

<?xml version="1.0" encoding="utf-8"?>
<SequenceResumeResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Success</Result>
</SequenceResumeResponse>

Note: Please contact your sales representative at +1 (801) 995-4550 or sales@mozenda.com for more information about enabling Sequences on your account.
back to top

Sequence.Run

Description

Starts a specific sequence.

Required parameters

SequenceID

Optional parameters

StepNumber (Starts the Sequence at the step number specified and skips all previous steps.)

Returns

The result of the operation and, if the request was successful, the JobID.

Example request url

https://api.mozenda.com/rest?WebServiceKey=7BA008DF-6B13-492C-97E6-1B1042D1DC02&Service=Mozenda10&Operation=Sequence.Run&SequenceID=1001&StepNumber=1002

Example response

<?xml version="1.0" encoding="utf-8"?>
<SequenceRunResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Success</Result>
    <JobID>15982</JobID>
</SequenceRunResponse>

Note: Please contact your sales representative at +1 (801) 995-4550 or sales@mozenda.com for more information about enabling Sequences on your account.
back to top

Need more information?

We are anxious to answer any questions you may have about our products and services. Please feel free to send us a request and we will respond immediately.

Thanks for your submission.