Web API Reference Guide > Available API Methods > Job Queue Methods > The jobqueueAddJob Method

The jobqueueAddJob Method

Create a new job.

Version: 1.6

Required Permissions: Full

HTTP method: POST

Supported by Editions: Zend Server

Request Parameters:  

Parameter

 Type

Required

Description

url

Array

Yes

A URL for the job.

vars

Array

No

Variables for the rule, passed to the ZendJobQueue API.

options

Array

Yes

Rule options, passed to the ZendJobQueue API.

Note:

Details about the options and vars parameters can be found in the ZendJobQueue API reference. For all intents and purposes, they are identical.

Expected Response Code: 200 OK - Returned for successfully creating the rule according to the provided parameters. For more information see Response Format.

Possible Action Specific Error Codes: None.

Example

Usage Example

Request

POST /ZendServer/Api/jobqueueAddJob

url=http%3A%2F%2Fmyhost%2Fmyjob.php

Response

<?xml version="1.0" encoding="UTF-8"?>

<zendServerAPIResponse xmlns="http://www.zend.com/server/api/1.3">

<requestData>

<apiKeyName><![CDATA[Admin]]></apiKeyName>

<method>jobqueueAddJob</method>

</requestData>

<responseData>

<jobInfo>

<job>

<id>1</id>

<type></type>

<nodeId></nodeId>

<queueName></queueName>

<status>ok</status>

<priority>1</priority>

<persistent></persistent>

<script><![CDATA[http://url/of/job]]></script>

<name></name>

<creationTime></creationTime>

<creationTimeTimestamp></creationTimeTimestamp>

<startTime></startTime>

<startTimeTimestamp></startTimeTimestamp>

<endTime></endTime>

<endTimeTimestamp></endTimeTimestamp>

<schedule></schedule>

<scheduleTime></scheduleTime>

<scheduleTimeTimestamp></scheduleTimeTimestamp>

<scheduleId></scheduleId>

<applicationId></applicationId>

<application></application>

</job>

<jobDetails>

<jobId>1</jobId>

<vars><![CDATA[{}]]></vars>

<output><![CDATA[]]></output>

<httpHeaders><![CDATA[]]></httpHeaders>

<error><![CDATA[]]></error>

</jobDetails>

</jobInfo>

</responseData>

<zendServerAPIResponse>

 

Read Also

  Available API Methods    
  Job Queue Methods