Creating a job.
Create a draft job via the Web Service. You can then update this draft job with the necessary information.
Function
createJob()
Parameters
- username:
String- Account login name.
- password:
String- Account password.
- jobName:
String- Job name. Must be a unique name.
- categoryId:
Integer- Category to create job in.
-1for default top level category.
Return
int:Job ID: The job id of the newly created jo
Exception
- Exception
Documentation
- To create a Job via the Web Service, use this function:
createJob() - To update the necessary information for the Job via the Web Service, use function:
updateJob()
Examples
public void createJobSample() throws Exception {
Puresend p = new Puresend();
PuresendPortType port = p.getPuresendHttpsSoap12Endpoint();
String username = "XXX";
String password = "XXX";
String jobName = "Enter Non Existing Name";
// Use default top level category
Integer categoryId = -1;
Integer jobId = port.createJob(username, password, jobName, categoryId);
if(jobId > 0) {
System.out.println("Job has been created with id:" + jobId);
// use updateJob() to update the Job.
}
}
<?php
$url='https://hed-ui.puresend.com/services/Puresend?wsdl';
$params = <<<EOT
<ns1:createJob>
<ns1:username>XXX</ns1:username>
<ns1:password>XXX</ns1:password>
<ns1:jobName>Enter Non Existing Name</ns1:jobName>
<ns1:categoryId>-1</ns1:categoryId>
</ns1:createJob>
EOT;
$sopaVar = new SoapVar($params, XSD_ANYXML);
$client = new SoapClient($url);
$res = $client->createJob($sopaVar);
var_dump($res);
?>