Salesforce webhook for Wufoo form integration

I have a wufoo form (survey) which goes out to different clients. On submit I want the wufoo form to call an Apex REST class on my Salesforce org and post data which will be created in a record for a custom object.

Salesforce webhook for Wufoo form integration

The Webhook URL is:

This is my code for the post:

global with sharing class SurveyWebhook {
    global static void getSurveyData() {
        RestRequest req = RestContext.request;
        System.debug('------------------- survey data from wufoo: ' + JSON.deserializeuntyped(req.requestBody.toString()));

I do not know the format of the POST data Wufoo is going to send.
When I submit the form it gives an error for the webhook integration saying:

(401) [{“message”:”Session expired or

I believe this is because I am not sending the session id or some authorzation key. How do I do this? Also, how do I read the data from the POST body?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

As you are setting up the REST service as WebHook, you have to access this over a public URL.

You can’t access the service with this Salesforce instance URL
without authorization.

In Wufoo console I don’t think there is any option to provide Salesforce authentication/authorization details.

So first create a site and add the REST class and any relevant objects/fields to your Site’s Public Access Settings. So that you can access the REST methods via the Site URL without login.

The URL will look like this: https://<Your Site URL>/services/apexrest/MySurveyClass

Add this URL as WebHook URL in Wufoo console. Now you are ready to get the form details in Salesforce and do your processing like saving in a custom object.

Your REST Class should look like this:

global with sharing class MySurveyClass {
    global static void doPost(){
        RestRequest req = RestContext.request;
        String EntryId = req.params.get('EntryId');
        String Field1 = req.params.get('Field1');

Where EntryId, Field1 are the form field names in the Wufoo form.

The quickest way to see what data will be sent from the webhook is to submit a new entry to your form and visit the following link to see the entry in xml format with all the relevant fields: https://<yourAccountName><yourFormName>/entries.xml

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x