The CreateSource service allows you to create a new source.
SOAP Action: CreateSource
SOAP Return Object: CreateSourceResp
The following table describes the parameters used for calling the CreateSource service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
source | Y | String | The source name |
The following table describes the parameters returned from the CreateSource service.
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 |
0 | No error |
---|---|
220 | Authentication error, see header object for detailed information |
221 | Source name is mandatory |
222 | Source already exists |
500 | Internal error |
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"; } ?>