Skip to content

Instantly share code, notes, and snippets.

@tristansokol
Created December 15, 2017 20:49
Show Gist options
  • Save tristansokol/d1efb924a2edc2bf6157672bb37432b4 to your computer and use it in GitHub Desktop.
Save tristansokol/d1efb924a2edc2bf6157672bb37432b4 to your computer and use it in GitHub Desktop.
var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "sq0atp-xxxxxxxx";
var api = new SquareConnect.LocationsApi();
api.listLocations().then(function(data) {
console.log('API called successfully. Returned data: ');
console.log(data);
}, function(error) {
console.error(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment