Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 1.5 KB

mobile-authorization.md

File metadata and controls

53 lines (35 loc) · 1.5 KB

Mobile Authorization

IMobileAuthorizationApi mobileAuthorizationApi = client.MobileAuthorizationApi;

Class Name

MobileAuthorizationApi

Create Mobile Authorization Code

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.

CreateMobileAuthorizationCodeAsync(Models.CreateMobileAuthorizationCodeRequest body)

Parameters

Parameter Type Tags Description
body Models.CreateMobileAuthorizationCodeRequest Body, Required An object containing the fields to POST for the request.

See the corresponding object definition for field details.

Response Type

Task<Models.CreateMobileAuthorizationCodeResponse>

Example Usage

var body = new CreateMobileAuthorizationCodeRequest.Builder()
    .LocationId("YOUR_LOCATION_ID")
    .Build();

try
{
    CreateMobileAuthorizationCodeResponse result = await mobileAuthorizationApi.CreateMobileAuthorizationCodeAsync(body);
}
catch (ApiException e){};