-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsample.php
More file actions
20 lines (16 loc) · 806 Bytes
/
Copy pathsample.php
File metadata and controls
20 lines (16 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php
$account_id = "add here store account id";
$authToken = "add here access token"
$base_url = 'https://api.softtouch.eu/1/accounts/' . $account_id . '/';
// Curl to fetch products
$api_url = $base_url . 'products?stores=01&online=1&display=full&take=500'; // TO get products
$httpRequest = curl_init();
curl_setopt($httpRequest, CURLOPT_HTTPHEADER, array('Authorization: ' . $authToken, 'Content-Type: application/json'));
curl_setopt($httpRequest, CURLOPT_URL, $api_url);
curl_setopt($httpRequest, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($httpRequest);
if ($response === FALSE){
die(curl_error($httpRequest));
}
curl_close($httpRequest);
$product_arr = json_decode($response);