Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 2.3 KB

MobileAuthorizationApi.md

File metadata and controls

57 lines (36 loc) · 2.3 KB

SquareConnect.MobileAuthorizationApi

All URIs are relative to https://connect.squareup.com

Method HTTP request Description
createMobileAuthorizationCode POST /mobile/authorization-code CreateMobileAuthorizationCode

createMobileAuthorizationCode

CreateMobileAuthorizationCodeResponse createMobileAuthorizationCode(body)

CreateMobileAuthorizationCode

Generates code to authorize a mobile application to connect to a Square card reader Authorization codes are one-time-use and expire 60 minutes after being issued. Important: The `Authorization` header you provide to this endpoint must have the following format: ``` Authorization: Bearer ACCESS_TOKEN ``` Replace `ACCESS_TOKEN` with a valid production authorization credential.

Example

var SquareConnect = require('square-connect');
var defaultClient = SquareConnect.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new SquareConnect.MobileAuthorizationApi();

var body = new SquareConnect.CreateMobileAuthorizationCodeRequest(); // CreateMobileAuthorizationCodeRequest | An object containing the fields to POST for the request.  See the corresponding object definition for field details.

apiInstance.createMobileAuthorizationCode(body).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Parameters

Name Type Description Notes
body CreateMobileAuthorizationCodeRequest An object containing the fields to POST for the request. See the corresponding object definition for field details.

Return type

CreateMobileAuthorizationCodeResponse

Authorization

oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json