• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

  • Important: Any reported problems and issues with your integration will be reported to you and we will encourage the app developers help to resolve those integration issues.

Pre Filtering a Webhook

Some software does not offer a way to filter and send webhooks on different events. In conditions like this, they offer customers to add a single webhook URL in their application and they send all the different kinds of events on the same webhook URL.

For example, A billing application might be sending a Payment Failed Status as well as a Payment Success Status on the same webhook URL.

Working with filters can be confusing. So we have created the Pre-filtering condition for the webhooks. Here's a guide explaining more about the different Pre-filtering conditions you can use.

Below would be a list of the Pre-filter conditions. To demonstrate how the condition works, a value will be specified. Different fields would then be supplied to be tested against the value.

1. When the Pre-filter key is at the root level such as "Status"

👉 Here we take an example of Instamojo webhook response

1664867995502.png


Suppose a webhook JSON payload is like:

Code:
{
    "link_id": "le6a0d86fa66a43918ea07907967",
    "payment_id": "MOJO2a0D82581190",
    "status": "succesful",
    "currency": "INR",
    "amount": "9.00",
    "mac": "fb4707f4b120ed939d4238451474c6e6f9"
}


You can see from the above JSON payload, the "status" key is at the root level. If you need to grab the "status" value for filter condition field then you can grab it using specifying the key within double-curly braces as follows :
{{status}}


👉 Applying Filter Condition in the Trigger
1664870463265.png



👉Adding Inbuilt Action

API Endpoint URL:
https://connect.pabbly.com/api/check_multistep_filter?pc_force_stop=1

HTTP Method: Post



1664877150679.png


Similarly, you can also use these logic:

"eq" => "Equal to", "neq" => "Does not equal to", "cs" => "Contains", "ncs" => "Does not contain", "set" => "Exists", "nset" => "Does not exist", "empt" => "Is empty", "nempt" => "Is not empty", "sw" => "Starts with", "nsw" => "Does not start with", "ew" => "Ends with", "new" => "Does not end with", "lt" => "Less than", "gt" => "Greater than",

Note: https://connect.pabbly.com/api/check_multistep_filter?pc_force_stop=1 parameter pc_force_stop=1 in the URL Forcefully stops workflow if filter condition does not match.


Case 1. When the response captured is fail workflow couldn't continue forward as the trigger event as per the filter condition.

1664881775675.png




Case 2. When the response captured is Success workflow will continue forward as the trigger event as per the filter condition.


1664880097753.png



2. When the Pre-filter key is at the nested level such as "payload>payment>entity>status".

👉 Here we take an example of Razorpay webhook response

1664882205609.png

In the above image you can check the normal trigger response capture from Razorpay webhook. Where payment status can be "Captured", "Authorized", "Failed".

Suppose you have a JSON payload having any array like:

Code:
"payload": {
        "payments": [
            {
                "entity": {
                    "id": "pay_DESlfW9H8K9uqM",
                    "entity": "payment",
                    "amount": 100,
                    "currency": "INR",
                    "base_amount": 100,
                    "status": "captured",
                    "order_id": "order_DESlLckIVRkHWj",
                    "invoice_id": null,
                    "international": false,
                    "method": "netbanking",         
                    "card_id": null,
                    "bank": "HDFC",
                    "wallet": null,
                    "vpa": null,
                    "email": "[email protected]",
                    "contact": "+919876543210",
                    "notes": [],
                    "fee": 2,       
                    "acquirer_data": {
                        "bank_transaction_id": "0125836177"
                    },
                    "created_at": 1567674599
                }
            }
        ]
    }

You can see from the above JSON payload, "payments" is an array of objects. If you need to grab the "status" value then you can grab it using:
{{payload==>payments==>0==>entity==>status}}


👉 Applying Filter Condition in the Trigger


1664883352168.png



👉Adding Inbuilt Action

API Endpoint URL:
https://connect.pabbly.com/api/check_multistep_filter?pc_force_stop=1

HTTP Method: Post

1664883032834.png


You can also use these logics in Request Body JSON.

"eq" => "Equal to", "neq" => "Does not equal to", "cs" => "Contains", "ncs" => "Does not contain", "set" => "Exists", "nset" => "Does not exist", "empt" => "Is empty", "nempt" => "Is not empty", "sw" => "Starts with", "nsw" => "Does not start with", "ew" => "Ends with", "new" => "Does not end with", "lt" => "Less than", "gt" => "Greater than"

Case 1. When the response captured is failed workflow couldn't continue forward as the trigger event as per the filter condition.


1664903461778.png



Case 2. When the response is Captured, workflow will continue forward as the trigger event as per the filter condition.


1664903740725.png



Similarly, if you have a JSON payload having any object like:

Code:
payload": {
        "payments": {
                "entity": {
                    "id": "pay_DESlfW9H8K9uqM",
                    "entity": "payment",
                    "amount": 100,
                    "currency": "INR",
                    "base_amount": 100,
                    "status": "captured",
                    "order_id": "order_DESlLckIVRkHWj",
                    "invoice_id": null,
                    "international": false,
                    "method": "netbanking",         
                    "card_id": null,
                    "bank": "HDFC",
                    "wallet": null,
                    "vpa": null,
                    "email": "[email protected]",
                    "contact": "+919876543210",
                    "notes": [],
                    "fee": 2,       
                    "acquirer_data": {
                        "bank_transaction_id": "0125836177"
                    },
                    "created_at": 1567674599
                }
            }
      
    }

As you can see from the above JSON payload, where status is the nested object. If you need to grab the "status" value then you can grab it using:
{{payload==>payments==>entity==>status}}


When the condition is true the webhook will work with the single step and stop the next step.

For example, within Facebook Pages, we have set the condition :

For reference: https://connect.pabbly.com/inbuilt_...MwNTZiIg_3D_3D_pc/IjU3NjIwNTY1MDYzZTA0MzQi_pc

Code:
{
    "or": [
        [
            {
                "source": "{{item}}",
                "logic": "eq",
                "value": "comment"
            }
        ]
    ]
}

For the "Post" we have set up the conditions like this:
Code:
{
"or": [
[
{
"source": "{{item}}",
"logic": "eq",
"value": "status"
}
],
[
{
"source": "{{item}}",
"logic": "eq",
"value": "photo"
}
],
[
{
"source": "{{item}}",
"logic": "eq",
"value": "video"
}
]
]
}
 

Attachments

  • 1664879606635.png
    1664879606635.png
    49.7 KB · Views: 186
  • 1664879763568.png
    1664879763568.png
    93.3 KB · Views: 186
  • 1664880183748.png
    1664880183748.png
    50.8 KB · Views: 179
  • 1664880399067.png
    1664880399067.png
    50.8 KB · Views: 181
Last edited by a moderator:
Top