Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Latest commit

 

History

History
74 lines (53 loc) · 2.85 KB

MobileAuthorizationApi.md

File metadata and controls

74 lines (53 loc) · 2.85 KB

Square.Connect.Api.MobileAuthorizationApi

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

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

CreateMobileAuthorizationCode

CreateMobileAuthorizationCodeResponse CreateMobileAuthorizationCode (CreateMobileAuthorizationCodeRequest 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

using System;
using System.Diagnostics;
using Square.Connect.Api;
using Square.Connect.Client;
using Square.Connect.Model;

namespace Example
{
    public class CreateMobileAuthorizationCodeExample
    {
        public void main()
        {
            
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

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

            try
            {
                // CreateMobileAuthorizationCode
                CreateMobileAuthorizationCodeResponse result = apiInstance.CreateMobileAuthorizationCode(body);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling MobileAuthorizationApi.CreateMobileAuthorizationCode: " + e.Message );
            }
        }
    }
}

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]