Help Needed: Webhook Returning Undefined Result

Hello, I am currently writing a function to integrate the college score card api. I already added the api as a source in Data Connection and configured a webhook to take in a parameter “school_name” and return data about the corresponding schools. When I wrote a typescript function to make a call to the webhook, the webhook returned an undefined result.

Here is the function :

 @Query()
    public async getCollegeInfo(): Promise<string> {
        try {
            const response = await GetCollegeData.webhooks.FetchCollegeData.call({
                school_name: "Harvard University"
            });

            console.log(response);
            return JSON.stringify(response);
        } catch (error) {
            console.error("Error fetching college information:", error);
            throw new Error("Failed to fetch college information");
        }
    }

Would you mind providing some more information here? Perhaps screenshots of your source + webhook configuration?

Does the webhook work when you use the webhook test panel?

1 Like

Yes, my webhook works when I use the webhook test panel. My function now actually works. I did not know that you can make api calls or webhook calls in the live preview. Only after I published my function did the webhook return the correct data.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.