0

I'm building bigcommerce APP. But I cannot get "AuthToken". Please help. See full code below. Also attached image with NULL response.

require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/vendor/autoload.php');
use Bigcommerce\Api\Client as Bigcommerce;

$object = new \stdClass();
$object->client_id = BC_CLIENT_ID;
$object->client_secret = BC_CLIENT_SECRET;
$object->redirect_uri = 'https://yourwebsiteurl.com/oauth.php';
$object->code = $_GET['code'];
$object->context = $_GET['context'];
$object->scope = $_GET['scope'];

$authTokenResponse = Bigcommerce::getAuthToken($object);

image

Vlad
  • 1
  • 2
  • Because immediately after you call `Bigcommerce::getAuthToken($object);` you overwrite whatever that returned with the constant `BC_ACC_TOK`. – Sammitch Sep 20 '17 at 17:50
  • Sorry that was just for testing static authtoken. Please delete those 2 raws – Vlad Sep 21 '17 at 12:40

0 Answers0