- A web server such as MAMP or Apache. A localhost address will work fine for the hello world app.
- PHP
- Composer
-
Fork the repo (optional).
-
Clone the repo.
git clone https://github.com/bigcommerce/hello-world-app-php-silex
-
Use Composer to install the dependencies.
php composer.phar install
-
Click Log In.
-
Provide your credentials at the prompt (same as you use to log into your store).
-
Click My Apps.
-
Click Create an app.
-
Provide a name for your app at the prompt.
-
Click Next> through App Summary, Details, and Launch Bar: no entries required.
-
On the Technical page, type http://localhost:8000/auth/callback into the Auth Callback URL field.
-
Select some OAuth scope other than the defaults.
-
Click Save and close.
-
Hover over your new app in the My Apps dashboard.
-
Click View Client ID.
-
Use the method appropriate to your operating system and web server software to add the following environment variables.
BC_AUTH_SERVICE=https://login.bigcommerce.com BC_CLIENT_ID=<contents of Client ID field> BC_CLIENT_SECRET=<contents of Client Secret field>
-
Restart the software or the entire host as needed to set the environment variables.
- Log into your store and go to your control panel.
- Click Apps in the left-hand navigation bar.
- Click My Drafts in the top navigation bar.
- Click the sample app. It will have the name that you assigned it in the developer portal.
- Click the Install button.
- At the prompt, click Confirm.
- Click through the browser warning about the self-signed certificate, if applicable.
- Copy the path inside the browser address bar and paste it into a text editor. The string between oauth?code= and & is your OAuth key. The string between stores% and & is your store hash. Using these values, you can proceed to make calls to the Bigcommerce Stores API.