The GetSources service allows you to retrieve a list of all sources for an account.
SOAP Action: GetSources
SOAP Return Object: GetSourcesResp
The following table describes the parameters used for calling the GetSources service.
Parameter | Mandatory | Type | Description |
---|---|---|---|
header | Y | APIRequestHeader | Header for authentication |
The following table describes the parameters returned from the GetSources 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 |
sources | / | Array of SourceType | Sources |
0 | No error |
---|---|
220 | Authentication error, see header object for detailed information |
500 | Internal error |
Get a list of all sources in an account
<?php $header->header->userId = MY_USER_ID; $header->header->userToken = MY_TOKEN; $getSourcesReq->header = $header; $getSourcesResp = $SoapClient->__soapCall("GetSources", array($getSourcesReq)); if ($getSourcesResp ->errorCode == 0) { foreach ($getSourcesResp->sources as $source) { echo $source->id . " - " . $source->name; } } else { echo "GetResources failed: " . $getSourcesResp->errorMessage; } ?>