SquareConnect::MobileAuthorizationApi
August 2, 2018 ยท View on GitHub
All URIs are relative to https://connect.squareup.com
| Method | HTTP request | Description |
|---|---|---|
| create_mobile_authorization_code | POST /mobile/authorization-code | CreateMobileAuthorizationCode |
create_mobile_authorization_code
CreateMobileAuthorizationCodeResponse create_mobile_authorization_code(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
# load the gem
require 'square_connect'
# setup authorization
SquareConnect.configure do |config|
# Configure OAuth2 access token for authorization: oauth2
config.access_token = 'YOUR ACCESS TOKEN'
end
api_instance = SquareConnect::MobileAuthorizationApi.new
body = SquareConnect::CreateMobileAuthorizationCodeRequest.new # CreateMobileAuthorizationCodeRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
begin
#CreateMobileAuthorizationCode
result = api_instance.create_mobile_authorization_code(body)
p result
rescue SquareConnect::ApiError => e
puts "Exception when calling MobileAuthorizationApi->create_mobile_authorization_code: #{e}"
end
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
HTTP request headers
- Content-Type: application/json
- Accept: application/json