extApi()

This procedure completes an HTTP request with the specified HTTP method

ParameterTypeDescription
httpMethod10AMandatorySpecifies the HTTP method to use. Valid values are GET, POST, PUT and DELETE. You can also use already prepared constant values from Aperio copy book: HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_PUT and HTTP_METHOD_DELETE
url2048A VARYINGMandatoryURL at which to complete the request.
httpHeader10240A VARYINGOptionalAn optional header XML document. To use the default HTTP header, do not pass the parameter or specify the empty string. See Foundational HTTP functions at IBM Knowledge Center for a description of the header content.
requestMsg65535A VARYINGOptionalSpecifies the data to update at the specified URL. This parameter is crucial for the POST and PUT methods - if it hasn’t been passed then the empty string request is sent.

Procedure returns response message data structure (see data structure description bellow).

Response message data structure

FieldTypeDescription
returnCode10i 0Return code. 0 means everything is OK. Other values in case of error (or warning). Look at list of return codes below.
httpStatusCode10i 0HTTP status code. See List of HTTP status codes for more details. Most popular HTTP status codes have been added to Aperio copy book as constatns. Look at the list below.
httpHeader10000AHeader information returned from the HTTP request in XML format.
body50000AThe normal HTTP response for the request in the format specific for given service, e.g. for SOAP it can be XML, REST API usually responses in JSON.
Return codes
ValueTypeAperio copy book constant nameDescription
0successEXTAPI_SUCCESSEverything is OK
1warningEXTAPI_SUCCESS_WRNRequest succeeded but with some warnings
-16000errorEXTAPI_HTTP_REQUEST_ERRequest sent to external API ended with errors.
-16100errorEXTAPI_HTTP_METHOD_ERHTTP method name is not correct
-16200errorEXTAPI_RESP_LEN_EXCEEDED_ERResponse length (for header or body) exceeds the size of fields in response data structure
-32603errorAPI_INTERNAL_ERRInternal error occurred
HTTP status codes
ValueAperio copy book constant nameDescription
200HTTP_STATUS_OKOK
201HTTP_STATUS_CREATEDCreated
204HTTP_STATUS_NO_CONTENTNo content
304HTTP_STATUS_NOT_MODIFIEDNot modified
400HTTP_STATUS_BAD_REQUESTBad request
401HTTP_STATUS_UNAUTHORIZEDUnauthorized
403HTTP_STATUS_FORBIDDENForbidden
404HTTP_STATUS_NOT_FOUNDNot found
409HTTP_STATUS_CONFLICTConflict
500HTTP_STATUS_INT_SERVER_ERRInternal server error