ServiceAPI Properties
In this section, the ServiceAPI class properties are presented in alphabetical order.
Description
Use the HttpMethod property to return the HTTP method that was invoked for the transaction.
Example
If %This.ServiceAPI.HttpMethod = %AppService_HTTP_GET then
/* process a GET request */
End-If;
Description
The HttpResponseCode property returns the actual HTTP response code from the third party as an integer value.
Examples of response code are 200, 400.
This property is read-only.
Example
&RespCode = &ServiceAPI.HttpResponseCode;
Description
Use the InputRows property to get values on the specified row.
Example
&Inst = %This.ServiceAPI.InputRows [1].getParameter("instrument");
Description
Use the IsChatbot property to determine whether the request came from ODA.
Example
if %This.ServiceAPI.IsChatbot then
/* perform Chatbot specific update */
End-if;
Description
Use the OutputRows property to set values on the specified row.
Example
%This.ServiceAPI.OutputRows [1].setParameter("numPlayers", 3);
Description
Use the OverrideResultStateDesc property to override the result state description.
Example
%This.ServiceAPI.ResultState = "Failure";
%This.ServiceAPI.OverrideResultStateDesc = "bad data";
Description
The ResponseException property returns a string of the actual exception (if any) that was sent back from the third party. Depending on the provider of the integration, the HTTP response code (if an error response code) includes additional information about the error.
This property is read-only.
Description
The ResponseFailed property specifies whether the response failed from the third party. This property takes a Boolean value: true, if the response failed; false otherwise.
This property is read-only.
Example
If &ServiceAPI.ResponseFailed Then
/* throw error */
Else
/* process response */
End-If;
Description
Use the ResultState property to set the result state to be returned for the request.
Example
%This.ServiceAPI.ResultState = "SUCCESS - PLAY MUSIC";
Description
The root resource of the URI that was used to invoke the application service request.
Example
&RootResource = %This.ServiceAPI.RootResource;
Description
The service ID that is used to invoke the application service request.
Example
&SrvID = %This.ServiceAPI.ServiceID;
Description
Use the URIIndex property to return the URI index that is invoked as defined on the application service.
Example
If %This.ServiceAPI.HttpMethod = %AppService_HTTP_GET Then
If %This.ServiceAPI.URIIndex = 1 Then
/* process request */
End-if;
End-if;
Description
Use the UserException property to specify whether a user handles any exception. This property takes a Boolean value: true, if the exception is handled by a user; false otherwise.
This property is read/write.