i2Rest_POST_data

From i2Rest
Jump to: navigation, search

Use this object to define parameters of sending request to API endpoint and processing API response

Field Type Description Default value
api_endpoint string REQUIRED. API endpoint

Defines URL to send HTTP request

method string REQUIRED. HTTP method

i2Camunda will use this method when sending HTTP request to the API endpoint
Valid values:

  • *POST
  • *GET
  • *PUT
  • *DEL
body string or object REQUIRED. Request's body

Request body can be defined as simple string or as object

  • String value will be sent as is. It should be a string in application/json format. Maximum length of body string is 5000 bytes
  • When using object, body can contain following properties:
    • string - provides body as a string (5000 bytes max)
    • or file_variable - defines name of process variable (type File), which contain payload to be sent to API endpoint
    • mime_type - type of body content. If not defined, "application/json" will be used for "string" body, for "file_variable" - content type of appropriate File variable

Examples:

body: "{\"var1\":\"value1\"}"
body: {
   string   :"<var1>value1</var1>",
   mime_type:"application/xml"
}
body: {
   file_variable: "BODY"
}
token string OAuth2 authorization token

This value will be sent to API endpoint in Authorization:Bearer header

client_id, client_secret string Client's ID and password

These values will be added to query part of API endpoint. Use these values to define client's ID and password

headers object Additional request headers

This object is used to define additional headers of HTTP request to API endpoint. Headers object should be defined in the following form:

header1: value1,
header2: value2,
...etc...
api_response_provided integer Size of allowed response

Maximum size of response that will be stored in response variable. If greater than zero, i2Camunda will save API response body to string response variable. The name of string response variable is defined in i2Camunda configuration object (i2camunda_response_file_variable, default - "i2camunda_response")

file_api_response object Parameters of File response variable

If defined, i2Camunda will save response into File variable with following attributes (required properties of file_api_response object):

  • filename
  • mimetype
  • encoding

The name of File response variable is defined in i2Camunda configuration object (i2camunda_response_file_variable, default - "i2camunda_response_file")

on_error string BPMN error code

If defined, i2Camunda will raise BPMN error with this code instead of creating incident.