Plugin Regex Behavior

👍

For Developer and Pro Serv team.

Plugins can send requests to any webhook endpoint, provided that the body of the request is JSON serializable. This capability allows for dynamic interactions and integrations with external services.

You can replace variables in the URL or the body of the request with data extracted using regex. This is particularly useful for customizing requests based on runtime data.

Data captured by regex's will be available within the plugin runtime and accessed with named capture groups.

To use data captured between plugins can use the save function to persist that data to the call session context (CSC) and then can be referenced from another plugin within same session.

example:

If you're plugin is making a request to external API, you can persist data from that API response.

If this is the response from API called in webhook:

{  
   "first_name": "John"  
}

Then in the success section, can persist this information to the call session context by referencing the field name you want to save

You can reference this saved value in your CSC with <webhook_first_name>

If you're response is a list of objects like:

[ { "first_name": "John" }, ... ]

Then you can access by specifying the index of the object you want to pulled:

<save 0.first_name as webhook_first_name>

Similarly, if you want to save the regex captured data you would reference the group regex name in the save function:

regex

sounds good, I'll add (?<additional_policy_first_name>\w+) to the policy now

->

when succeed