Service: CreateSource

The CreateSource service allows you to create a new source.

Service Details

SOAP Action: CreateSource
SOAP Return Object: CreateSourceResp

Input

The following table describes the parameters used for calling the CreateSource service.

Table: instance of CreateSourceReq

Parameter Mandatory Type Description
header Y APIRequestHeader Header for authentication
source Y String The source name

Output

The following table describes the parameters returned from the CreateSource service.

Table: instance of CreateSourceResp

Parameter Mandatory Type Description
header / APIResponseHeader Header containing authentication information
errorCode / Integer Numerical value of the error
errorMessage / String Short literal description of the error

Table: response codes of CreateSourceResp.

0 No error
220 Authentication error, see header object for detailed information
221 Source name is mandatory
222 Source already exists
500 Internal error

Example

This example shows you the creation of a new source.

<?php
$header->userId = USER_ID;
$header->userToken = USER_TOKEN;

$createSourceReq->header = $header;
$createSourceReq->source = 'My source';

$createSourceResp = $SoapClient->__soapCall("CreateSource", array($createSourceReq));

if ($createSourceResp ->errorCode == 0) {
	echo "Source created";
} else {
	echo "Source creation failed";
}
?>