GithubHelp home page GithubHelp logo

sphere-hello-api-php's Introduction

SPHERE.IO icon

PHP Hello API

Build Status

An example to authenticate your application to SPHERE.IO and get your products, using PHP and the Sphere PHP SDK.

Run SDK example

Add your project key, client id and secret to config.php.

# Install Composer if not installed yet
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the dependencies:

composer install

Then activate the php builtin web server

cd <project_folder>
php -S localhost:8000 -t sdk/

Now navigate to http://localhost:8000 in your browser.

Run RAW example

Add your project key, client id and secret to config.php.

Then activate the php builtin web server

cd <project_folder>
php -S localhost:8000 -t raw/

Now navigate to http://localhost:8000 in your browser.

sphere-hello-api-php's People

Contributors

emmenko avatar

Stargazers

Charles Buchler avatar

Watchers

Ratan Sebastian avatar Sven Müller avatar Thomas Carton de Wiart avatar Hauke Rahm avatar Adnan Asani avatar Dirk Hoerig avatar Lam Tran avatar James Cloos avatar Roman Butenko avatar Josh Bones avatar Auto Mation avatar Denis Werner avatar Martin avatar Kelly Goetsch avatar Mitsch Reichmann avatar Lucia Hegenbartova avatar Islam farg avatar Amadeus Magrabi avatar Philipp Sporrer avatar Camilo Jimenez avatar Sebastian Weikart avatar Jens Schulze avatar sahil anand avatar Luciano Giavedoni avatar Stela avatar Adrian Makohon avatar Luis G avatar Yacine Gasmi avatar Stefanie Oehmichen avatar  avatar

sphere-hello-api-php's Issues

Get Bad Request on basic install

After cloning this project and having it installed and setup, and served on localhost on 8000 port as described, I get back the following error:

Client error response [url] https://auth.sphere.io/oauth/token [status code] 400 [reason phrase] Bad Request' in /.../sphere-hello-api-php/vendor/commercetools/php-sdk/src/Error/ApiException.php on line 68

I assume that the auth part is working properly, but actually the php-sdk is sending the request in a bad form when trying to invoke:
$response = $request->executeWithClient($client); # at index.php on line 15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.