Skip to main content

Building a Web Application

The Sequentum Enterprise API can be used to run agents from your own applications. When using the API directly, your application needs security privileges that are standard for desktop applications, but not for web applications. It can be a complex task to ensure a web application has the required security privileges, and you may end up giving the application too many security privileges, making it vulnerable to security breaches.

NOTICE

We don't support using the full API from a web application. We only support the use of the API proxy in web applications. You may be able to use the full API, depending on the security policies on the web server. We are unable to help you configure a web server for this purpose.

We recommend you use the Sequentum Enterprise agent service when using the API in web applications. The Sequentum Enterprise agent service provides most API functionality through a simple proxy assembly that requires no special security settings and depends on no other files than the single proxy assembly file. The proxy assembly can run in both 32-bit and 64-bit applications, which makes it even easier to use this assembly rather than the full API.

Using the Sequentum Enterprise Agent Service

Sequentum Enterprise includes a Windows service that can be used to run agents. Your web application communicates with the Windows service using a small proxy assembly that requires no special security privileges and depends on no other files. You simply add the proxy assembly to your web application's assembly references and use the proxy to call the API functions. The proxy assembly contains the same methods as the standard API, except for functions used to load and save agents. The proxy can only execute agents, not load agents, because the proxy is designed to rely on no other assemblies and loading an agent would require the agent definition classes found in the full Sequentum Enterprise API.

Before you can use the proxy to communicate with the Windows Service, you need to connect to the service. You use the proxy method Connect to connect to the service. The default connection string is:

http://localhost:8003/ContentGrabber

If your Sequentum Enterprise service is located on a remote server, you can change localhost to the name or IP address of the remote server. The service is listening on port 8003 by default, but you can change the port in the Sequentum Enterprise editor. The Sequentum Enterprise service is stopped by default and configured to start manually. If you are going to use this service, you should configure the service to start automatically.

All Windows services, including the Sequentum Enterprise agent service, run in a special Windows session that cannot interact with users and cannot display user interfaces. JavaScript on some websites does not work correctly without at least a hidden web browser window. Such websites are rare, but if you need to run such a website through the Sequentum Enterprise agent service, the service needs to run the agent in a normal user session. In order for the Windows service to start an agent in a normal user session the following three conditions must be met.

  1. You must set the agent option Run Interactively.

  2. The Sequentum Enterprise agent service must run under the System account.

  3. A user must be logged onto the computer while the agent runs. The agent will run in the Windows session of the logged in user, but in the security context of the System account.

Example

The following example connects to a local Sequentum Enterprise agent service and runs an agent in a new session. It also sets the log level to high and specifies that log information should be written to file.

string sessionId = Guid.NewGuid().ToString();
AgentProxy proxy = new AgentProxy(@"C:\Users\Public\Documents\Content Grabber\
Agents\qantas\qantas.scg", sessionId);
proxy.Connect("http://localhost:8003/ContentGrabber");
AgentSettings settings = new AgentSettings();
settings.LogLevel = AgentLogLevel.High;
settings.IsLogToFile = true;                
proxy.StartAgent(settings); 

You can connect to the Sequentum Enterprise agent service again at any time to get status information about a specified agent running in a specified session.

AgentProxy qantasProxy = new AgentProxy(@"C:\Users\Public\Documents\Content Grabber\
Agents\qantas\qantas.scg", sessionId);
qantasProxy.Connect("http://localhost:8003/ContentGrabber");
AgentStatus status = qantasProxy.GetAgentStatus();

If you are running an agent from a web application, you could use AJAX callbacks to get status information about a running agent. You only have to keep track of the session ID between callbacks.

Proxy Functions

The following functions are available in the proxy assembly:

Property or Function

Description

AgentProxy(string agentNameOrPath, string sessionId)

Instantiates a new proxy with the specified agent and session ID. You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

AgentProxy(string agentNameOrPath)

Instantiates a new proxy without a session. You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

void Connect(string endPointAddress)

Connects to the Sequentum Enterprise agent service. You can specify the server name or IP address and port number. The default connection string for a local service is:

http://localhost:8000/ContentGrabber

void CloseConnection()

Closes the connection to the Sequentum Enterprise agent service.

void StartAgent()

Starts the agent specified when instantiating the proxy. The agent will run asynchronously.

void StartAgent(AgentSettings settings)

Starts the agent with additional settings. The agent will run asynchronously. See below for more information about the AgentSettings class.

void StopAgent()

Stops the agent if it is currently running asynchronously.

void CloseAgentSession()

Closes an agent session after the agent has been run asynchronously. When you close an agent session, all data associated with that session is removed and you will not be able to retrieve status information about the agent that ran in this session. You can only close a session if an agent is not currently running in the session.

You don't need to close a session. Session data will be removed automatically after the agent has completed running and the session timeout has elapsed. The default session timeout is 30 minutes, so by default session data will be removed automatically 30 minutes after the agent has completed.

AgentStatus GetAgentStatus()

Returns status information about an agent that has been run asynchronously. See below for more information about the AgentStatus class.

DataTable GetAgentProgressAsDataTable()

Returns progress information in a DataTable about an agent running in asynchronously. See below for more information about the information returned.

DataTable GetAgentProgressAsJson()

Returns progress information as JSON about an agent running in asynchronously. See below for more information about the information returned.

DataTable GetAgentLogAsDataTable(int offset, int limit)

Returns log data in a DataTable for an agent that has been run asynchronously. This function does not return any data if logging is disabled or if logging is written to file. See below for more information about the information returned.

offset (optional): Index of the first log entry to return.

limit (optional): Index of the last log entry to return.

string GetAgentLogAsJson(int offset, int limit)

Returns log data as JSON for an agent that has been run asynchronously. This function does not return any data if logging is disabled or if logging is written to file. See below for more information about the information returned.

offset (optional): Index of the first log entry to return.

limit (optional): Index of the last log entry to return.

DataSet GetAgentDataAsDataSet(int offset, int limit)

Returns extracted data in a DataSet for an agent that has been run asynchronously.

offset (optional): Index of the first data entry to return.

limit (optional): Index of the last data entry to return.

string GetAgentDataAsJson(int offset, int limit)

Returns extracted data as a JSON string for an agent that has been run asynchronously.

offset (optional): Index of the first data entry to return.

limit (optional): Index of the last data entry to return.

string GetAgentDataAsXml(int offset, int limit)

 

Returns extracted data as an XML string for an agent that has been run asynchronously.

offset (optional): Index of the first data entry to return.

limit (optional): Index of the last data entry to return.

RunAgentReturnJson(string agentNameOrPath, string sessionId, int limit)

Runs an agent synchronously and returns extracted data as a JSON string. The agent is always run in a session when the agent supports sessions, and the session is closed automatically after the agent has completed its run.

limit (optional): Maximum number of data rows to return.

RunAgentReturnXml(string agentNameOrPath, string sessionId, int limit)

 

Runs an agent synchronously and returns extracted data as an XML string. The agent is always run in a session when the agent supports sessions, and the session is closed automatically after the agent has completed its run.

limit (optional): Maximum number of data rows to return.

RunAgentReturnDataSet(string agentNameOrPath, string sessionId, int limit)

Runs an agent synchronously and returns extracted data in a DataSet. The agent is always run in a session when the agent supports sessions, and the session is closed automatically after the agent has completed its run.

limit (optional): Maximum number of data rows to return.

RunAgentReturnJson(AgentSettings settings, int limit)

Runs an agent synchronously with additional settings and returns extracted data as a JSON string. The agent is always run in a session when the agent supports sessions, and the session is closed automatically after the agent has completed its run.

See below for more information about the AgentSettings class.

limit (optional): Maximum number of data rows to return.

RunAgentReturnXml(AgentSettings settings, int limit)

 

Runs an agent synchronously with additional settings and returns extracted data as an XML string. The agent is always run in a session when the agent supports sessions, and the session is closed automatically after the agent has completed its run.

See below for more information about the AgentSettings class.

limit (optional): Maximum number of data rows to return.

RunAgentReturnDataSet(AgentSettings settings, int limit)

Runs an agent synchronously with additional settings and returns extracted data in a DataSet. The agent is always run in a session when the agent supports sessions, and the session is closed automatically after the agent has completed its run.

See below for more information about the AgentSettings class.

limit (optional): Maximum number of data rows to return.

DeleteInternalDatabase(string key,string agentNameOrPath, string sessionId)

Deletes the internal DB data for given agent.

ExportToTarget(string key,string agentNameOrPath, string sessionId)

Exports the data for used export targets.

RegenerateExportData(string key,string agentNameOrPath, string sessionId)

Regenerates the exported data.

 AgentSettings

The following agent settings can specified when running an agent:

Property or Function

Description

bool LogLevel

Log detail level. Set the log level to None to turn off logging.

bool IsLogHtml

Logs the raw HTML of all web pages processed by the agent.

bool IsLogToFile

Logs data to a file instead of a database table.

int Timeout

This value specifies the session timeout in minutes when an agent is run asynchronously. All session data is removed automatically when the agent has completed and this timeout has elapsed. The default session timeout is 30 minutes.

This value specifies the maximum number of seconds an agent will run when it's run synchronously. When the timeout is reached, the agent will stop and close its session if it's run in a session. The default timeout is 30 seconds.

Dictionary<string, string> InputParameters

A list of input parameters.

GlobalData

Any serializable data object can be stored in this dictionary and will be available to all scripts in an agent. Notice that input parameters will eventually be stored in this dictionary as well, so it doesn't matter if you use input parameters or global data to store your input data.

ProxyList

A list of web proxies that will be used by the agent. If a proxy list is specified, it overrides any default proxy settings in the agent.

 AgentStatus

An agent can provide the following status information:

Property or Function

Description

AgentRunningStatus RunStatus

The RunStatus can be one of the following values.

  • Completed. The agent has completed successfully.

  • Incomplete. The agent has completed, but stopped prematurely. The agent may have been stopped manually.

  • Failed. The agent has completed, but a critical error occurred.

  • Idle. The agent has never been run.

  • Starting. The agent is starting.

  • ExportingData. The agent is exporting data to the specified export target.

  • Stopping. The agent is in the process of stopping.

  • Restarting. The agent is restarting. This usually occurs when the agent needs to clear JavaScript memory leaks.

  • ExportFailed. The agent completed, but failed to export data.

int PageLoads

The number of page loads. This includes AJAX calls triggered by agent actions.

TimeSpan Runtime

The amount of time the agent has run.

int MissingElements

The number of times an agent command could not find it's specified content where the content was not specified as optional.

int PageErrors

The number of page load errors. This includes errors loading content from AJAX calls that were triggered by agent actions.

DateTime StartTime

The time the agent started.

 Agent Progress Data

An agent can provide progress data in a DataTable. The DataTable contains a DataRow for each web browser the agent is using to extract data. Each DataRow contains a status column and a description column. The progress data is the same information displayed when running an agent in the Sequentum Enterprise agent editor.

Agent Log Data

An agent can provide log data in a DataTable. The DataTable contains a log level column and a description column. A log level of 1 means an error, 2 means a warning and 3 means information. The log data is the same data you can view in the Sequentum Enterprise agent editor.

Agent Export Data

The API can provider extracted data in a DataSet, as an XML string or as a JSON string. For large amount of data, use the parameters offset and limit to page through the data. Offset is the index of the first data entry to return and limit is the index of the last data entry to return. The API method GetAgentStatus returns a value Export Row Count which contains the total number of data entries available. See Data Counting for more information about the Export Row Count value.

Using Simple Web Requests

The Sequentum Enterprise Windows service supports simple web requests, so you can execute agents and retrieve extracted data from non-Windows environments, such as from a PHP page on a Linux server.

The Windows service is listening for web requests on port 8004 by default. You can change this port number in the Sequentum Enterprise editor. The service is stopped by default and configured to start manually. If you are going to use this service, you should configure the service to start automatically. Please see Using the Content Grabber Agent Service for more information about the Windows service.

This is an example of a web request that executes an agent named Sequentum and provides some input values for the agent.

http://localhost:8004/ContentGrabber/RunAgentReturnJson?agent=sequentum&pars={"StartDate":"2015-10-15","EndDate":"2015-12-15"}

The above web request executes the agent synchronously and returns the extracted data as a JSON string.

Web Request Functions

The following functions are available when using web requests:

Property or Function

Description

StartAgent?agent={agentNameOrPath}&sessionId={sessionId}&sessionTimeout={sessionTimeout}&runMethod={runMethod}&logLevel={logLevel}&logHtml={isLogHtml}&logToFile={isLogToFile}&pars={inputParameters}&key={key}

Starts an agent that will run asynchronously.

This function supports both GET and POST requests. If you need to specify a long list of input parameters you must use POST requests, since GET requests are limited in length.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent will run in a session with the specified session ID.

sessionTimeout (optional): If the agent is running in a session, this value specifies the number of minutes the agent data will be available before it's deleted. The default session timeout is 30 minutes.

runMethod (optional): The run method specifies how an agent should be run, and must be one of the following values:

  • Restart

  • Continue

  • ContinueAndRetryErrors

logLevel (optional): Log detail level. Set the log level to None to turn off logging. The default log level is None. Accepted values are None, Low, Medium and High.

logHtml (optional): Logs the raw HTML of all web pages processed by the agent. The default value is False.

logToFile (optional): Logs data to a file instead of a database table. The default value is False.

pars (optional): A JSON formatted list of input values that can be used by the agent. The JSON string should be URL encoded.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

RunAgentReturnJson?agent={agentNameOrPath}&sessionId={sessionId}&runMethod={runMethod}&timeout={timeout}&logLevel={logLevel}&logHtml={isLogHtml}&logToFile={isLogToFile}&pars={inputParameters}&limit={limit}&key={key}

Runs an agent synchronously and returns the extracted data as a JSON string.

The agent is always run in a session when the agent supports sessions, and the session is closed automatically after the agent has completed its run.

This function supports both GET and POST requests. If you need to specify a long list of input parameters you must use POST requests, since GET requests are limited in length.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

runMethod (optional): The run method specifies how an agent should be run, and must be one of the following values:

  • Restart

  • Continue

  • ContinueAndRetryErrors

timeout (optional): This maximum number of seconds an agent will run. When the timeout is reached, the agent will stop and close its session if it's run in a session. The default timeout is 30 seconds.

logLevel (optional): Log detail level. Set the log level to None to turn off logging. The default log level is None. Accepted values are None, Low, Medium and High.

logHtml (optional): Logs the raw HTML of all web pages processed by the agent. The default value is False.

logToFile (optional): Logs data to a file instead of a database table. The default value is False.

pars (optional): A JSON formatted list of input values that can be used by the agent. The JSON string should be URL encoded.

limit (optional): The maximum number of results to return.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

RunAgentReturnXml?agent={agentNameOrPath}&sessionId={sessionId}&runMethod={runMethod}&timeout={timeout}&logLevel={logLevel}&logHtml={isLogHtml}&logToFile={isLogToFile}&pars={inputParameters}&limit={limit}&key={key}

Runs an agent synchronously and returns the extracted data as an XML string.

The agent is always run in a session when the agent supports sessions, and the session is closed automatically after the agent has completed its run.

This function supports both GET and POST requests. If you need to specify a long list of input parameters you must use POST requests, since GET requests are limited in length.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

runMethod (optional): The run method specifies how an agent should be run, and must be one of the following values:

  • Restart

  • Continue

  • ContinueAndRetryErrors

timeout (optional): This maximum number of seconds an agent will run. When the timeout is reached, the agent will stop and close its session if it's run in a session. The default timeout is 30 seconds.

logLevel (optional): Log detail level. Set the log level to None to turn off logging. The default log level is None. Accepted values are None, Low, Medium and High.

logHtml (optional): Logs the raw HTML of all web pages processed by the agent. The default value is False.

logToFile (optional): Logs data to a file instead of a database table. The default value is False.

pars (optional): A JSON formatted list of input values that can be used by the agent. The JSON string should be URL encoded.

limit (optional): The maximum number of results to return.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

StopAgent?agent={agentNameOrPath}&sessionId={sessionId}&key={key}

Stops the agent if it is currently running asynchronously.

This function supports only GET requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent session you want to stop if the agent runs in sessions.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

CloseAgentSession?agent={agentNameOrPath}&sessionId={sessionId}&key={key}

Closes an agent session after the agent has been run asynchronously. When you close an agent session, all data associated with that session is removed and you will not be able to retrieve status information about the agent that ran in this session. You can only close a session if an agent is not currently running in the session.

You don't need to close a session. Session data will be removed automatically after the agent has completed running and the session timeout has elapsed. The default session timeout is 30 minutes, so by default session data will be removed automatically 30 minutes after the agent has completed.

This function supports only GET requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId: The agent session you want to close.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

GetAgentProgressAsJson?agent={agentNameOrPath}&sessionId={sessionId}&key={key}

Returns progress information as JSON about an agent running in a asynchronously. See below for more information about the information returned.

This function supports only GET requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent session if the agent runs in sessions.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

GetAgentLogAsJson?agent={agentNameOrPath}&sessionId={sessionId}&offset={offset}&limit={limit}&key={key}

Returns log data as JSON for an agent that has been run asynchronously. This function does not return any data if logging is disabled or if logging is written to file. See below for more information about the information returned.

This function supports only GET requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent session if the agent runs in sessions.

offset (optional): Index of the first log entry to return.

limit (optional): Index of the last log entry to return.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

GetAgentDataAsJson?agent={agentNameOrPath}&sessionId={sessionId}&offset={offset}&limit={limit}&key={key}

Returns extracted data as a JSON string for an agent that has been run asynchronously.

This function supports only GET requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent session if the agent runs in sessions.

offset (optional): Index of the first data entry to return.

limit (optional): Index of the last data entry to return.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

GetAgentDataAsXml?agent={agentNameOrPath}&sessionId={sessionId}&offset={offset}&limit={limit}&key={key}

Returns extracted data as an XML string for an agent that has been run asynchronously.

This function supports only GET requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent session if the agent runs in sessions.

offset (optional): Index of the first data entry to return.

limit (optional): Index of the last data entry to return.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

GetInfoForAllAgentsAsJson?directory={directory}&userName={userName}&password={password}&key={key}

Returns all information about all agents in a specified directory. Username and password of a Windows user is required to retrieve scheduling information.

This function supports only GET requests.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. When using the Windows Task Scheduler a username and password of a Windows user is required to retrieve scheduling information. If username and password is not specified, this function returns scheduling information from the internal scheduler.

This function accepts the following parameters:

directory (required): The root directory of all agents to retrieve information from.

userName (required): The user name of a Windows account that can access scheduled tasks.

password (required): The password of a Windows account that can access scheduled tasks.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

GetAgentInfoAsJson?agent={agentNameOrPath}&sessionId={sessionId}&userName={userName}&password={password}&key={key}

Returns all information about a specified agent. Username and password of a Windows user is required to retrieve scheduling information.

This function supports only GET requests.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. When using the Windows Task Scheduler a username and password of a Windows user is required to retrieve scheduling information. If username and password is not specified, this function returns scheduling information from the internal scheduler.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent session if the agent runs in sessions.

userName (required): The user name of a Windows account that can access scheduled tasks.

password (required): The password of a Windows account that can access scheduled tasks.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

GetAgentScheduleInfoAsJson?agent={agentNameOrPath}&sessionId={sessionId}&userName={userName}&password={password}&key={key}

Returns scheduling information about a specified agent.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. When using the Windows Task Scheduler a username and password of a Windows user is required to retrieve scheduling information. If username and password is not specified, this function returns scheduling information from the internal scheduler.

This function supports only GET requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent session if the agent runs in sessions.

userName (required): The user name of a Windows account that can access scheduled tasks.

password (required): The password of a Windows account that can access scheduled tasks.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

GetAgentRuntimeInfoAsJson?agent={agentNameOrPath}&sessionId={sessionId}&key={key}

Returns runtime information about a specified agent.

This function supports only GET requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent session if the agent runs in sessions.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

SetAgentSchedule?agent={agentNameOrPath}&isScheduleEnabled={isScheduleEnabled}&interval={interval}&intervalType={intervalType}&nextRunTime={nextRunTime}&logLevel={logLevel}&isLogToFile={isLogToFile}&userName={userName}&password={password}&isRunAsCurrentUser={isRunAsCurrentUser}&isRunOnlyWhenUserLoggedIn={isRunOnlyWhenUserLoggedIn}&key={key}

Sets the schedule of a specified agent. Username and password of a Windows user is required to set a schedule.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. This function adds a schedule using the Windows Task Scheduler.

This function supports both GET and POST requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

isScheduleEnabled (required): Specifies if the scheduled task should be added or removed. If the agent is already scheduled, the scheduled task will be replaced if this parameter is true and removed if the parameter is false.

interval (required): The scheduled interval. This must be a positive integer value.

intervalType (required): The type of interval. Accepted values are Seconds, Minutes, Hours or Days.

nextRunTime (required): The first time to run the scheduled task.

logLevel (required): Log detail level. Set the log level to None to turn off logging. The default log level is None. Accepted values are None, Low, Medium and High.

logHtml (required): Logs the raw HTML of all web pages processed by the agent. The default value is False.

logToFile (required): Logs data to a file instead of a database table. The default value is False.

userName (required): The password of a Windows account that can access scheduled tasks.

password (required): The password of a Windows account that can access scheduled tasks.

isRunAsCurrentUser (required): This parameter should be set to false, and a user name and password of an existing Windows user should be used instead.

isRunOnlyWhenUserLoggedIn (required): Specifies if the agent should only run when the specified Windows user is logged in. This parameter should normally be set to false.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

AddAgentSchedule?agent={agentNameOrPath}&sessionId={sessionId}&logLevel={logLevel}logFilePath={logFilePath}&cron={cron}&startTime={startTime}&inputParameters={inputParameters}&key={key}

Adds a schedule to a specified agent.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. This function adds a schedule using the internal scheduler.

This function supports both GET and POST requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent will run in a session with the specified session ID.

logLevel (required): Log detail level. Set the log level to None to turn off logging. The default log level is None. Accepted values are None, Low, Medium and High.

logFilePath (optional): Logs to this file path. Logs to a default file path if this parameter is not specified.

cron (required): A Cron expression that specifies when to run the agent. See Cron Expressions for more information.

startTime (required): The first time to run the agent.

inputParameters (optional): JSON formatted input parameters that will be provided to the agent.

Example:

{"par1":"value1","par2":"value2"}

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

UpdateAgentSchedule?agent={agentNameOrPath}&sessionId={sessionId}&scheduleId={scheduleId}&logLevel={logLevel}&logFilePath={logFilePath}&cron={cron}&startTime={startTime}&inputParameters={inputParameters}&key={key}

Updates a schedule for a specified agent.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. This function updates a schedule in the internal scheduler.

This function supports both GET and POST requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent will run in a session with the specified session ID.

scheduleId (required): The ID of the schedule to update. The ID can be retrieved from a call to GetAgentScheduleInfoAsJson.

logLevel (required): Log detail level. Set the log level to None to turn off logging. The default log level is None. Accepted values are None, Low, Medium and High.

logFilePath (optional): Logs to this file path. Logs to a default file path if this parameter is not specified.

cron (required): A Cron expression that specifies when to run the agent. See Cron Expressions for more information.

startTime (required): The first time to run the agent.

inputParameters (optional): JSON formatted input parameters that will be provided to the agent.

Example:

{"par1":"value1","par2":"value2"}

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

UpdateOrAddAgentSchedule?agent={agentNameOrPath}&sessionId={sessionId}&logLevel={logLevel}logFilePath={logFilePath}&cron={cron}&startTime={startTime}&inputParameters={inputParameters}&key={key}

Updates a schedule for the specified agent if there's exactly one schedule matching the agent path and session ID. Adds a schedule to the agent if there are no schedules matching the agent path and session ID. Returns an error if there's more than one schedule matching the agent path and session ID.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. This function updates or adds a schedule to the internal scheduler.

This function supports both GET and POST requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The agent will run in a session with the specified session ID.

scheduleId (required): The ID of the schedule to update The ID can be retrieved from a call to GetAgentScheduleInfoAsJson.

logLevel (required): Log detail level. Set the log level to None to turn off logging. The default log level is None. Accepted values are None, Low, Medium and High.

logFilePath (optional): Logs to this file path. Logs to a default file path if this parameter is not specified.

cron (required): A Cron expression that specifies when to run the agent. See Cron Expressions for more information.

startTime (required): The first time to run the agent.

inputParameters (optional): JSON formatted input parameters that will be provided to the agent.

Example:

{"par1":"value1","par2":"value2"}

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

DeleteAgentSchedule?key={key}&agent={agentNameOrPath}&scheduleId={scheduleId}

Deletes a schedule for a specified agent.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. This function deletes a schedule from the internal scheduler.

This function supports both GET and POST requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

scheduleId (required): The ID of the schedule to delete. The ID can be retrieved from a call to GetAgentScheduleInfoAsJson.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

DeleteAgentSchedules?key={key}&agent={agentNameOrPath}&sessionId={sessionId}

Deletes all schedules for a specified agent with the specified session ID.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. This function deletes a schedule from the internal scheduler.

This function supports both GET and POST requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The session ID of the schedules to delete.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

DeleteAllAgentSchedules?key={key}&agent={agentNameOrPath}

Deletes all schedules for a specified agent.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. This function deletes a schedule from the internal scheduler.

This function supports both GET and POST requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

RunAgentScheduleNow?key={key}&agent={agentNameOrPath}&sessionId={sessionId}&scheduleId={scheduleId}

Runs a schedule for a specified agent with the specified session ID and schedule ID. If no schedule ID is specified, an error is returned if there is more then one schedule that matches the agent and session ID.

Sequentum Enterprise can schedule agents using its internal scheduler or the Windows Task Scheduler. This function deletes a schedule from the internal scheduler.

This function supports both GET and POST requests.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

sessionId (optional): The session ID of the schedule to run.

scheduleId (optional): The ID of the schedule to run. The ID can be retrieved from a call to GetAgentScheduleInfoAsJson.

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

DeleteInternalDatabase?agent={agentNameOrPath}&sessionId={sessionId}&key={key}

Deletes the internal database data for a specified agent.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

sessionId (optional): The agent will run in a session with the specified session ID.

ExportToTarget?agent={agentNameOrPath}&sessionId={sessionId}&key={key}

Exports the data for a specified agent.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

sessionId (optional): The agent will run in a session with the specified session ID.

RegenerateExportData?agent={agentNameOrPath}&sessionId={sessionId}&key={key}

Regenerates the data for a specified agent.

This function accepts the following parameters:

agent (required): You can specify the full path to an agent file or just the name of the agent. If you only specify the agent name, Sequentum Enterprise will look for the agent in the default location for the user running the agent service. The default agent location for the local System account is:

C:\Users\Public\Documents\Content Grabber\Agents

key (optional): The access key used to determine which agents can be accessed if the Sequentum Enterprise API is restricted by access key. If a key is specified, the agentNameOrPath parameter should specify the agent name only without a path.

sessionId (optional): The agent will run in a session with the specified session ID.

http://{ipAddress}:{port}/ContentGrabber/DeactivateSELicense?key={key}

Deactivates the SE License key which is already activated on the machine.

ipAddress: IP Address of the server running Sequentum Enterprise.

port: Port of Sequentum Enterprise srevice 8004 or 8005.

http://{ipAddress}:{port}/ContentGrabber/ActivateSELicense?licenseKey={licenseKey}

Activates the SE License key.

ipAddress: IP Address of the server running Sequentum Enterprise.

port: Port of Sequentum Enterprise srevice 8004 or 8005.

http://{ipAddress}:{port}/ContentGrabber/ChangeSELicense?key={key}&licenseKey={licenseKey}

Changes the SE License key.

ipAddress: IP Address of the server running Sequentum Enterprise.

port: Port of Sequentum Enterprise srevice 8004 or 8005.

 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.