Creating a job from an existing job.

Creating a draft job from an existing job. You can then update this draft job with the necessary information.


Function

  • createJobFromExistingJob()

Parameters

  • username: String
    • Account login name.
  • password: String
    • Account password.
  • existingJobId: int
    • Job id of an existing job.
  • newJobName: String
    • Job name for the new draft job.

Return

  • int:
    • Job ID: The job id of the newly created jo

Exception

  • Exception

Documentation

  • Creating a draft job from an existing job. You can then update this draft job with the necessary information.
  • To create a draft job from an existing job via the Web Service, use this function:createJobFromExistingJob()
  • To update the necessary information for the Job via the Web Service, use function: updateJob()

Examples

public void createJobFromExistingJobSample() throws Exception {

        Puresend p = new Puresend();
        PuresendPortType port = p.getPuresendHttpsSoap12Endpoint();

        String username = "XXX";
        String password = "XXX";

        String newJobName = "Enter Non Existing Name";

        // Use default top level category
        Integer categoryId = -1;

        Integer existingJobId = 1234;

        Integer jobId = port.createJobFromExistingJob(username, password, existingJobId, newJobName);

        if(jobId > 0) {
            System.out.println("Job has been created with id:" + jobId);
            // use updateJob() to update the Job.
        }

}   

<?php

include 'puresend.php';

$p = new Puresend();

$createJobFromExistingJobData = new createJobFromExistingJob();
$createJobFromExistingJobData->username = 'XXX';
$createJobFromExistingJobData->password = 'XXX';
$createJobFromExistingJobData->newJobName = 'Enter Non Existing Name';
$createJobFromExistingJobData->existingJobId = 1234;

$response = $p->createJobFromExistingJob($createJobFromExistingJobData);
var_dump($response);

?>