bigcommerce-api-php icon indicating copy to clipboard operation
bigcommerce-api-php copied to clipboard

Bigcommerce\Api\NetworkError

Open mareeshwarantcs opened this issue 2 years ago • 0 comments

I tried to get the products count from my store, but i faced this issue. Plz help me to fix this issue or give the source code to connect the bigcommerce api to get the expect result

Expected behavior

Get Product Count from my store

Actual behavior

Ref: https://nimb.ws/Yjfaul

Steps to reproduce behavior

<?php
namespace App\Http\Controllers;
use Bigcommerce\Api\Client as Bigcommerce;
use Illuminate\Http\Response;
use Illuminate\Http\Request;
use Bigcommerce\Api\NetworkError;

class AppController extends Controller
{
	public function test(Request $request){

		$object = new \stdClass();
		$object->client_id = 's4q6oeuf3p3kvc5jvjfgy6grsq0y0w';
		$object->client_secret = '3a687f024482cb1193cc2a7c087df6a201334083749635e8446829a281fc92';
		$object->redirect_uri = "https://zamplebox.enterpriseapplicationdevelopers.com/index.php/oauth";
		$object->code = $request->get('code');
		$object->context = $request->get('context');
		$object->scope = $request->get('scope');

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

		echo "Product Count is ".$count;
	}
}

?>

mareeshwarantcs avatar May 17 '23 11:05 mareeshwarantcs