-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_sandbox.php
More file actions
29 lines (26 loc) · 824 Bytes
/
api_sandbox.php
File metadata and controls
29 lines (26 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
$proxyURL = 'http://www.countrybrookdesign.com/api/soap/?wsdl';
$apiUserName = 'channeladvisor';
$apiPassword = 'advisor';
// $proxyURL = 'http://caninenomad.com/magento/api/soap/?wsdl';
// $apiUserName = 'ocm_api';
// $apiPassword = 'letmein';
try {
echo "Setting up proxy", "\n";
$proxy = new SoapClient($proxyURL);
} catch (Exception $e) {
echo "Error in setting up proxy", "\n";
echo $e->getMessage(), "\n";
}
try {
echo "Setting up session", "\n";
$sessionId = $proxy->login($apiUserName, $apiPassword);
} catch (Exception $e) {
echo "Error in setting up sessionid", "\n";
echo $e->getMessage(), "\n";
}
$all_categories = $proxy->call($sessionId, 'category.tree');
print_r($all_categories['children'][0]['children']);
?>