Job.SetProxy

Prev Next

Description

Change a job's proxy pool when the job has paused or errored.

URL parameters

Name Required Type Description
JobID numeric string Job ID number.
Job.ProxyPool True string Name of the proxy the jobs will be set to use. Note that the actual name of a proxy is the Display Name with dashes and spaces removed.
AgentID True string The ID of the agent associated with the job you want to update the proxy for.

Returns

Name Type Description
Success boolean True if the specified job restarts successfully
ErrorMessage string Explanation of the error. Might include: JobID doesn't exist, user doesn't have permission to modify the job, proxy doesn't exist, etc.

Sample request

curl -X GET 'https://api.mozenda.com/rest??WebServiceKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=Job.SetParameter&ResponseFormat=JSON&JobID=1314&JobParameter.<Code>=123456789'

Sample responses

XML

Success

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

Error

<?xml version="1.0" encoding="utf-8"?>
<WebServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Result>Error</Result>
    <ErrorCode>Incorrect agent</ErrorCode>
    <ErrorMessage>Job 2148 is not a harvest job for agent 1017</ErrorMessage>
</WebServiceResponse>

JSON (add &ResponseFormat=JSON)

Sucess

{
    "JsonResult": {
        "Command": "Job.SetProxy",
        "AutoLoggedIn": false,
        "WebConsoleKey": "",
        "Result": "Success",
        "ErrorCode": "",
        "ErrorDescription": "",
        "ErrorList": []
    }
}

Error

{
    "JsonResult": {
        "Command": "Job.SetProxy",
        "AutoLoggedIn": false,
        "WebConsoleKey": "",
        "Result": "Error",
        "ErrorCode": "Missing parameter",
        "ErrorDescription": "'AgentID' parameter is not specified",
        "ErrorList": []
    }
}