requestOperationAuthorization
(Innovation Studio 21.2 and later)
Initiates a multi-factor authorization process.
Syntax
Copy
function requestOperationAuthorization(recordID: string, authOperationTypeName: string, initialStatusID: string, authorizedStatusID: string, rejectedStatusID: string, mobilePhone: string): IFtosReqAuthResponse
| Parameter |
Type |
Description |
|---|---|---|
recordID
|
string |
ID of the bearer entity record that undergoes the authorization operation. |
authOperationTypeName
|
string |
Action authorization type associated with the authorization operation. For details, see the Innovation Studio User Guide. |
initialStatusID
|
string |
Business workflow status ID that the record must be in to initiate the authorization operation. For details, see the Innovation Studio User Guide. |
authorizedStatusID
|
string |
Business workflow status ID that will be assigned to the record if the user authorizes the operation. For details, see the Innovation Studio User Guide. |
rejectStatusID
|
string |
Business workflow status ID that will be assigned to the record if the user rejects the operation. For details, see the Innovation Studio User Guide. |
mobilePhone(v21.2.2.7/v22.1.2 and later)
|
string |
Telephone number where the one-time-password is sent. If not specified, the password is delivered to the user account's default telephone number. |
Return Value
Returns a IFtosReqAuthResponse JSON object containing details about the authorization.
Copy
{
afterGenerateJs: string;
authSessionId: string;
template: string;
}
| Property | Type | Description |
|---|---|---|
afterGenerateJs
|
string | After Generate JS content of the authorization page set up for the request's authorization type. For more information, see the Innovation Studio User Guide. |
authSessionId
|
string | Unique ID of the authorization session. |
template
|
string | HTML content of the authorization page set up for the request's authorization type. The returned value has template tokens replaced with their actual values. For more information, see the Innovation Studio User Guide. |
Examples
In this example:
- We initiate a multi-factor authorization for the bearer entity record in the current client-side process. For more information, see context.
- The authorization type is defaultMFA.
- The initial business status of the record is Pending. Depending on the result of the authorization, the record will transition to either the Authorized or Rejected status. All business statuses belong to the Payments entity. For more information on how to retrieve the ID of a business status, see getBusinessStatus.
- We save the state of the authorization operation in a variable called reqResponse and we use the setData function to send the information to the client side call-back function.
Copy
var reqResponse = requestOperationAuthorization(context.id, 'defaultMFA',
getBusinessStatus('Payments', 'Pending'), getBusinessStatus('Payments', 'Authorized'), getBusinessStatus('Payments', 'Rejected'));
setData({requestAuthResponse: reqResponse});