I know nothing about API's. Need to use the Webhooks add-on. Please Help

Hi Y’all,

I have a client that needs me to pass form submissions through to a 3rd party CRM via an API call.

Will the webhooks add-on do this? If so, can anyone offer some advice on how to configure the add on?

Below is the API call to send the data to.

TIA!!!

$post_url = 'https://api.club-os.com/prospects?clubLocationId=[clubLocationId]' ;

$body = array(

'firstName' => $first_name,

'lastName' => $last_name,

'email' => $email,

'mobilePhone' => $mobile_phone,

'notes' => $notes,

'source' => $source,

'gender' => 'M'

);

$body_json = json_encode($body);

$args = array(

'headers' => array(

'Authorization' => 'Basic ' . base64_encode( '[username]' . ':' . '[password]' ),

'Content-type' => 'application/json'

),

'body' => $body_json,

'sslverify' => false

);

$resp = wp_remote_post( $post_url, $args );

Having the above code already you could easily adapt it to use the gform_after_submission hook, here’s an example of how to send data to a third-party using this hook: https://docs.gravityforms.com/gform_after_submission/#3-send-entry-data-to-third-party

All the data submitted is contained in the $entry object, so basically all you need is to replace variables like $first_name with the appropriate entry value. You can find examples of how to get data from $entry here.

For example, assuming that you have a name field with id 1 to get the user name, this line:

'firstName' => $first_name,

should be changed to this:

'firstName' => rgar( $entry, '1.3' ),

That said if you want to try using the Webhooks add-on instead, I would recommend you to check the documentation here.

Note that for the Authorization header you still need to use a small snippet, here’s an example. The other settings and field mapping can be done following the instructions for the feed creation.

2 Likes