extApi()
This procedure completes an HTTP request with the specified HTTP method
Parameter | Type | | Description |
httpMethod | 10A | Mandatory | Specifies 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 |
url | 2048A VARYING | Mandatory | URL at which to complete the request. |
httpHeader | 10240A VARYING | Optional | An 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. |
requestMsg | 65535A VARYING | Optional | Specifies 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
Field | Type | Description |
returnCode | 10i 0 | Return code. 0 means everything is OK. Other values in case of error (or warning). Look at list of return codes below. |
httpStatusCode | 10i 0 | HTTP 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. |
httpHeader | 10000A | Header information returned from the HTTP request in XML format. |
body | 50000A | The 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
Value | Type | Aperio copy book constant name | Description |
0 | success | EXTAPI_SUCCESS | Everything is OK |
1 | warning | EXTAPI_SUCCESS_WRN | Request succeeded but with some warnings |
-16000 | error | EXTAPI_HTTP_REQUEST_ER | Request sent to external API ended with errors. |
-16100 | error | EXTAPI_HTTP_METHOD_ER | HTTP method name is not correct |
-16200 | error | EXTAPI_RESP_LEN_EXCEEDED_ER | Response length (for header or body) exceeds the size of fields in response data structure |
-32603 | error | API_INTERNAL_ERR | Internal error occurred |
HTTP status codes
Value | Aperio copy book constant name | Description |
200 | HTTP_STATUS_OK | OK |
201 | HTTP_STATUS_CREATED | Created |
204 | HTTP_STATUS_NO_CONTENT | No content |
304 | HTTP_STATUS_NOT_MODIFIED | Not modified |
400 | HTTP_STATUS_BAD_REQUEST | Bad request |
401 | HTTP_STATUS_UNAUTHORIZED | Unauthorized |
403 | HTTP_STATUS_FORBIDDEN | Forbidden |
404 | HTTP_STATUS_NOT_FOUND | Not found |
409 | HTTP_STATUS_CONFLICT | Conflict |
500 | HTTP_STATUS_INT_SERVER_ERR | Internal server error |