POST Process Incoming Webhook API v1

Description

Processes an incoming webhook for an entry that is on an Incoming Webhook step. When an entry reaches this step, it pauses until a valid, authenticated request is received.

Authentication

Requires the API Key and API Secret defined in the step settings. These can be sent in the request body or as query string parameters.

No WordPress capability is required.

Using the Endpoint

POST /gravityformsapi/entries/{entry_id}/workflow-hooks

Required Parameters

KeyTypeDescription
entry_idintegerThe ID of the entry.
workflow-api-keystringAPI key configured in the step.
workflow-api-secretstringAPI secret configured in the step.

Optional Parameters

None.

Request Body

Data to update in the entry.

  • If Field Mapping is disabled in the step, the workflow will proceed as soon as a valid request is received.
  • If Field Mapping is enabled, key/value pairs in the request body (JSON or form-data) will be mapped to entry fields.

Response

Success

HTTP 200 OK with message “complete”.

Failure

HTTP 401 Unauthorized when authentication fails.

Usage

cURL Request

curl -X POST "https://{domain}/gravityformsapi/entries/{entry_id}/workflow-hooks" \
  -d "workflow-api-key=xxxxxxxx" \
  -d "workflow-api-secret=xxxxxxxx" \
  -d "demo-status=Resolved" \
  -d "demo-resolution=Rebooting the computer fixed the issue."

PHP Request

$response = wp_remote_post(
    'https://{domain}/gravityformsapi/entries/{entry_id}/workflow-hooks',
    array(
        'body' => array(
            'workflow-api-key'   => 'xxxxxxxx',
            'workflow-api-secret'=> 'xxxxxxxx',
            'demo-status'        => 'Resolved',
            'demo-resolution'    => 'Rebooting the computer fixed the issue.',
        ),
    )
);

if ( ! is_wp_error( $response ) ) {
    if ( 200 === wp_remote_retrieve_response_code( $response ) ) {
        // On success, response body contains "complete".
    } else {
        $error_message = wp_remote_retrieve_response_message( $response );
    }
} else {
    $error_message = $response->get_error_message();
}