Product events

Web trigger events

Web triggers are incoming HTTPS calls that invoke a function, such as from a third-party webhook implementation. Web triggers are configured in the app’s manifest and the URL to call is created through the Forge CLI.

The request is serialized to JSON and passed to the function in the format described below. The function that is invoked is responsible for parsing the JSON data.

The HTTP response is formed from the JSON format described below. If the function result is not compatible with the JSON format, then an error response with status code 500 is sent.

Learn more about web triggers.

Request

PropertyTypeRequiredDescription
bodystringHTTP request body.
headersobject

HTTP headers sent by the caller.

FormatnameOfTheHeader: array of strings

Example"Content-Type”: ["application/json”]

methodstringYesHTTP method used by the client. For example, GET, POST, PUT, or DELETE.
pathstringYesPath of request sent by the caller.
queryParameters{ [key: string]: string[] }Parsed values from the query string on the request URL.
*anyAdditional properties are provided to support forward compatibility.

Example

1
2
{
  "method": "POST",
  "headers": {
    "Accept": [
      "*/*"
    ],
    "Postman-Token": [
      "5249865e-4106-447d-aa17-52df5e57c2b9"
    ],
    "accept-encoding": [
      "gzip, deflate"
    ],
    "User-Agent": [
      "PostmanRuntime/7.13.0"
    ],
    "content-length": [
      "71"
    ],
    "Connection": [
      "keep-alive"
    ],
    "Host": [
      "localhost:8080"
    ],
    "Cache-Control": [
      "no-cache"
    ],
    "Content-Type": [
      "text/plain"
    ]
  },
  "body": "{\n\t\"hello\": 1,\n\t\"test\": [\"foo\", \"bar\"],\n\t\"foo\": {\n\t\t\"bar\": \"hello\"\n\t}\n}",
  "path": "/x1/XUBR5WnG2Hk2V52APDdGaRSDm",
  "queryParameters": {
    "apples": [ "red", "green" ],
    "grapes": [ "green" ]
  }
}

Response

PropertyTypeRequiredDescription
bodystringHTTP response body sent back to the caller.
headersobject

HTTP headers sent by the caller.

FormatnameOfTheHeader: array of strings

Example"Content-Type": ["application/json"]

statusCodeintegerYesHTTP status code returned to the caller.
statusTextstringText returned to communicate status. The text provides context to the status code.
*anyAdditional properties are provided to support forward compatibility.

Rate this page: