SalesKing oAuth Example Apps
Ruby PHP JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


SalesKing App Examples

SalesKing can be connected and enhanced using the API and Apps. Our Apps are using oAuth2 for authentication and authorization, like you may know it from facebook. When registering your app in SalesKing you get credentials(app id + secret) needed to identify your app and establish a trusted connection.


Before you start coding:

  • register your app in your SalesKing account ../developers/apps

  • grab a shiny new pair of app key & secret

Depending on the example our are using, Provide the right url's(app and canvas ) in the registration form and then edit the apps settings(inline) or the settings.yml file.

PHP plain

Completely stripped down example, visualizing:

  • user authentication

  • app authorization

  • app authentication

One page does it all, no caching or saving of access token or user information, so definitely NOT something you want to use in production.


The ruby examples impose some dependencies:

  • Sinatra: as webserver lifting the scripts into your browser

  • Curb(Curl): making the web requests, especially HTTPS without hassle

Most apps use bundler to prevent the gem-hassle and can be racked-up. Sinatra, by default, starts on port 4567, so you should use the following url when registering your app: http ://localhost:4567

Plain login

This is the same as the plain php example, a single view handling the triple-oAuth2 jump.

Advanced login

The app saves login information(access_token) encrypted in a cookie. It also demonstrates how to deal with dynamic SalesKing URL's(Subdomain for each account).

Push Notifications / PubSub

An app showing how to register for push notifications(WebHooks/PubSub) and how to deal with the callback results

Payment chart

Show payment or invoice stats in a zoomable chart.