Skip to main content

Get authorization code

Sends an SMS to the specified number to obtain a confirmation code

Function GetAuthorizationCode(Val AccessParameters, Val PhoneNumber) Export

ParameterCLI optionTypeRequiredDescription
AccessParameters--accessStructure Of KeyAndValueAccess parameters. See FormAccessParameters
PhoneNumber--phoneString, NumberPhone number without +
Returns

Map Of KeyAndValue - serialized JSON response from Green API

tip

Method at API documentation: StartAuthorization


1C:Enterprise/OneScript code example
ApiUrl = "https://3100.api.green-api.com/v3";
MediaUrl = "https://3100.api.green-api.com/v3";
IdInstance = "31003...";
ApiTokenInstance = "17915d8e0b4b4975a183478da...";

PhoneNumber = 441234567890;

AccessParameters = OPI_GreenMax.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenMax.GetAuthorizationCode(AccessParameters, PhoneNumber);