# Webhook test returns 500 error

**URL:** <https://community.hubspot.com/t/webhook-test-returns-500-error/16391>\
**Category:** APIs & Integrations\
**Tags:** object, webhooks\
**Created:** [September 24, 2019, 9:56am UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391 "2019-09-24T09:56:23Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![narainsagar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/narainsagar/32/48165_2.png) [@narainsagar](https://community.hubspot.com/u/narainsagar)\
**Post date:** [September 24, 2019, 9:56am UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/1 "2019-09-24T09:56:23Z")

</div>

Hello Community,

**FYI:** I have also posted it here: [https://community.hubspot.com/t5/APIs-Integrations/Webhook-test-returning-500-Error/m-p/292695/highlight/true#M27273](https://community.hubspot.com/t5/APIs-Integrations/Webhook-test-returning-500-Error/m-p/292695/highlight/true#M27273)

I am having the issue while creating webhook and test returns 500 error..

Here’s my application webhook subscription URL:

> **[Developers | HubSpot](https://app.hubspot.com/developer/6299815/application/200930/webhooks)**

Here’s my webhook POST method handler API endpoint:

[https://staging.dotandlinelearning.com/backend/api/hubspot/webhook](https://staging.dotandlinelearning.com/backend/api/hubspot/webhook)

^ This POST method actually fetches the deal information and associated contact information from through the payload-\>objectId and saves the fetched information into my DB table..

Here’s the test response; I get:

{ “statusCode”: 500 }

You may also check this screenshot:

 ![Screen Shot 2019-09-23 at 6.58.57 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/3/43647234a7d911a70d2da2b59b7e40bf0ba66786.png)  
webhook test

Following is my ssl certificate info screenshot:

 ![Screen Shot 2019-09-23 at 7.03.39 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/4/4f0cc53b98a392a83d2124a38ea3b7da027334b1.png)

**UPDATED:**

Moreover; According to this [solution](https://community.hubspot.com/t5/APIs-Integrations/Webhook-test-returning-500-Error/m-p/226686/highlight/true#M5582) by [@bkucenski](https://community.hubspot.com/t5/user/viewprofilepage/user-id/78710) I also have changed the SSL certificate from wildcard to single site SSL but still it doesn’t work for me i.e., returning the same 500 error.

P.S. Here’s the single site SSL info:

 ![Screen Shot 2019-09-24 at 5.53.10 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/4/e40cffa4b75ff3a53a177ebb8a1431209887dbb1.png)

I 'd like this be working as soon as possible, could anyone please help me fix this issue.

Thanks.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [September 24, 2019, 9:04pm UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/2 "2019-09-24T21:04:56Z")

</div>

Hi again, @narainsagar.

Let’s move the conversation into this new thread. Here’s how I responded to your other post earlier today:

I’m sorry to hear that you’re encountering these `500` errors, even after trying the recommendations above.

I haven’t diagnosed the cause yet, but could you help me by answering a few clarifying questions?

1. Are you able to successfully `POST` the sample data through a REST client like Postman?
2. Per the original poster’s comment, does the same webhook URL work in a workflow webhook action? You should have access to workflows in your developer test account ending in **9821**.

---

<div class="post-metadata">

**Author:** ![narainsagar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/narainsagar/32/48165_2.png) [@narainsagar](https://community.hubspot.com/u/narainsagar)\
**Post date:** [September 25, 2019, 9:36am UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/3 "2019-09-25T09:36:12Z")

</div>

Hello Isaac,

Thanks for the reply.

Re. your questions:

1. Yes - I am able to POST sample data through REST API client like Postman etc.

2. Yes - the same webhook URL work in a workflow webhook action.

Cheers,

Narain

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [September 25, 2019, 9:10pm UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/4 "2019-09-25T21:10:44Z")

</div>

Hey, @narainsagar.

Thanks so much for confirming. I’ll work with my team to get to the bottom of this. I apologize for the inconvenience.

---

<div class="post-metadata">

**Author:** ![narainsagar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/narainsagar/32/48165_2.png) [@narainsagar](https://community.hubspot.com/u/narainsagar)\
**Post date:** [September 26, 2019, 10:09am UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/5 "2019-09-26T10:09:02Z")

</div>

Hello Isaac,

Thanks for the response. I’ll wait for your update on this issue.

Also I want to know; will I be need a paid version of hubspot to get the webhooks work through hubspot developer portal application?

Currently our business needs doesn’t require any of the paid features so just for this single feature i.e., webhooks to trigger; I don’t think we can upgrade to enterprise paid plan.

FYI. Since - webhooks under workflow action requires enterprise plan. which is a huge amount in its own.

Also, if it is possible to use webhooks for free then what will be the limitations etc?

Would really appreciate if you could give your thoughts on this ^?

Cheers,

Thanks.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [September 26, 2019, 3:39pm UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/6 "2019-09-26T15:39:00Z")

</div>

Hi, @narainsagar.

I don’t have any updates on the `500` error issue yet, but I can certainly answer your other questions.

You do not need a paid subscription to leverage the [Webhooks API](https://developers.hubspot.com/docs/methods/webhooks/webhooks-overview). If an app has webhook subscriptions set up, they will fire in every type of account.

[Webhook actions in workflows](https://knowledge.hubspot.com/articles/kcs_article/workflows/how-do-i-use-webhooks-with-hubspot-workflows), on the other hand, _do_ require an \*Enterprise-\*level subscription (or trial).

To reiterate, you can _subscribe_ to changes with the Webhooks API in any account, but you need an \*Enterprise-\*level subscription to _send_ outgoing `POST` requests through workflows.

Please let me know if I can clarify further.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [September 27, 2019, 1:52pm UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/7 "2019-09-27T13:52:11Z")

</div>

Hi, @narainsagar.

On the `500` error issue, we were able to locate the response from your server.

It looks like the request handshake is fine as no exceptions are being thrown, but your system is responding with a `500` eror with the following body:

```auto
{ 
 "status":false,
 "message":"Trying to get property 'objectId' of non-object",
 "statusCode":500
}

```

Searching this error online, it appears to be [a PHP error](https://stackoverflow.com/questions/29296287/yii-error-500-trying-to-get-property-of-non-object).

---

<div class="post-metadata">

**Author:** ![narainsagar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/narainsagar/32/48165_2.png) [@narainsagar](https://community.hubspot.com/u/narainsagar)\
**Post date:** [September 30, 2019, 9:40am UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/8 "2019-09-30T09:40:14Z")

</div>

Hello @IsaacTakushi

Thanks for responding.

I have updated my API code a little bit, I am assuming json payload from request and fetching dealId like this below.

```auto
$payload = json_decode(file_get_contents('php://input'));
$dealId = $payload->{'objectId'};

```

Here’s the postman request:

 ![Screen Shot 2019-09-30 at 2.36.11 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/6/869ca82fc90032f1b068543b649f60d8235d2ffb.png)

Request body payload I’m assuming is like this:

```auto
{
"eventId": 1,
"subscriptionId": 166771,
"portalId": 6299815,
"occurredAt": 1569835128385,
"subscriptionType": "deal.propertyChange",
"attemptNumber": 0,
"objectId": 123,
"changeSource": "CRM",
"propertyName": "dealstage",
"propertyValue": "sample-value"
}

```

Can you please have a look now and let me know if this is fine?

But, I still get **500** error from webhook subscription Test.

Thanks.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 1, 2019, 11:43pm UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/9 "2019-10-01T23:43:01Z")

</div>

Hi, @narainsagar.

Apologies for the delayed response.

I was able to replicate the behavior in Postman. The full `500` error is:

```auto
{
 "status": false,
 "message": "HTTP/1.1 404 Not Found\r\nDate: Tue, 01 Oct 2019 23:19:48 GMT\r\nContent-Type: application/json;charset=utf-8\r\nContent-Length: 101\r\nConnection: keep-alive\r\nSet-Cookie: __cfduid=d970f4a1e9e5f4a8c7d17484d1e3cf7221569971986; expires=Wed, 30-Sep-20 23:19:46 GMT; path=/; domain=.hubapi.com; HttpOnly\r\nX-Trace: 2B165491A88E95D867A0525DF63A6B9E43B737D18F000000000000000000\r\nX-HubSpot-NotFound: true\r\nX-HubSpot-RateLimit-Daily: 500000\r\nX-HubSpot-RateLimit-Daily-Remaining: 499967\r\nX-HubSpot-RateLimit-Interval-Milliseconds: 10000\r\nX-HubSpot-RateLimit-Remaining: 99\r\nX-HubSpot-RateLimit-Max: 100\r\nX-HubSpot-RateLimit-Secondly: 10\r\nX-HubSpot-RateLimit-Secondly-Remaining: 9\r\nVary: Accept-Encoding\r\nAccess-Control-Allow-Credentials: false\r\nStrict-Transport-Security: max-age=31536000; includeSubDomains; preload\r\nExpect-CT: max-age=604800, report-uri=\"https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct\"\r\nServer: cloudflare\r\nCF-RAY: 51f229d59bd8d597-BOM\r\n\r\n{\"status\":\"error\",\"message\":\"Deal does not exist\",\"requestId\":\"9d1f9ad5-da9a-4d12-822a-4e19187f6d6c\"}",
 "statusCode": 500
}

```

There is a `404` `Deal does not exist` message from HubSpot inside the `message` property of your service’s `500` response.

As you said in your original post:

_ **“This `POST` method actually fetches the deal information and associated contact information from through the payload-\>`objectId` and saves the fetched information into my DB table.”** _

When you test the webhook, your code makes a `GET` request to the [Deals API](https://developers.hubspot.com/docs/methods/deals/get_deal) for a deal with the `"objectId": 123` before it returns a response to HubSpot’s `POST` request. The problem is that deal ID `123` is fake — no deal in any HubSpot account has that ID. So, the deals endpoint returns the `404` `Deal does not exist` error and your code returns a `500` error with HubSpot’s response to your `GET` request as the `message`.

The root of the issue is that your code is trying to look up dummy data for `"objectId": 123`. Try substituting the ID of a real deal in your test account.

---

<div class="post-metadata">

**Author:** ![narainsagar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/narainsagar/32/48165_2.png) [@narainsagar](https://community.hubspot.com/u/narainsagar)\
**Post date:** [October 3, 2019, 11:56am UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/10 "2019-10-03T11:56:53Z")

</div>

Hello Isaac,

Thanks for the response.

Yes that sample deal is **123** is fake. I have created some deals in my testing account having deal IDs are below:

**1046280606** (Deal name: Test deal 1)

**1046986853** (Deal name: Test deal 2)

**1047019119** (Deal name: Test deal 3)

**1047138608** (Deal name: Test Fariha)

Also, here’s the working Postman below (i.e., showing **200** success response):

 ![Screen Shot 2019-10-03 at 4.44.16 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/a/aa6587a8c82cc12fe4c056fb13167fa4a5a32b81.png)

So, I have disabled the workflow trigger action in my testing account AND have create a subscription in the developer APP. But when I change deal property it actually doesn’t seems to trigger my webhook. I don’t know whats the issue but am unable to find why and how the webhook trigger will work?

**FYI:** I have testing account API\_KEY enabled on my server right now, when it will work then I’ll switch it to real account API KEY.

Moreover; Here’re the screenshots of my webhook configs & setting etc.

 ![Screen Shot 2019-10-03 at 4.58.54 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/b/b5d0f0570f3bf2b1e6df5488f38dc9bb3af266fd.png)

 ![Screen Shot 2019-10-03 at 4.59.13 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/a/ea16215ea1a9792dfc58e488211e3447cdd444b7.png)

Please give your thoughts.

Thanks for your consistent co-operation and support.

Cheers,

---

<div class="post-metadata">

**Author:** ![narainsagar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/narainsagar/32/48165_2.png) [@narainsagar](https://community.hubspot.com/u/narainsagar)\
**Post date:** [October 3, 2019, 12:22pm UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/11 "2019-10-03T12:22:40Z")

</div>

Hello Isaac,

Thanks for responding back.

Yes - I’ve tested Postman with actual Testing dealId and it gives success **200** response as shown in the screenshot below:

 ![Screen Shot 2019-10-03 at 4.44.16 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/a/aa6587a8c82cc12fe4c056fb13167fa4a5a32b81.png)

Also; I have created some dummy deals in my Hubspot Testing account having Deal IDs as below (i.e., marked as BOLD):

**1046280606** (Test Deal 1)

**1046986853** (Test Deal 2)

**1047019119** (Test deal3)

**1047138608** (Test Fariha)

Since it now works with Postman and everything seems to be good. But still it doesn’t seems to work with APP webhook subscription.

FYI. I’ve disabled my webhook workflow action in Testing account and Just have webhook subscription created in the APP as shown below:

 ![Screen Shot 2019-10-03 at 4.58.54 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/b/b5d0f0570f3bf2b1e6df5488f38dc9bb3af266fd.png)

 ![Screen Shot 2019-10-03 at 4.59.13 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/a/ea16215ea1a9792dfc58e488211e3447cdd444b7.png)

As it seems the webhook subscription will trigger whenever Deal’s **dealstage** property changes.

Right now, I have the Testing account API KEY enabled on my server to communicate with hubspot. I don’t know why it still not working when I create deals and change dealstage.

Could you please give your thoughts on this,

Thanks for your consistent co-operation and support.

Cheers,

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 3, 2019, 7:30pm UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/12 "2019-10-03T19:30:21Z")

</div>

Hi, @narainsagar.

Sorry for the spam/abuse trouble. I’ve found that this platform tends to flag posts with either large or many code blocks and/or multiple screenshots, even if they’re not malicious. It looks like one of my colleagues restored your posts, so we can continue speaking here.

I’m glad to see that you got the tests to work in Postman!

In order for your application to detect `dealstage` property changes and send your webhook URL a notification, your app must be connected to [your developer test account](https://app.hubspot.com/integrations-settings/6299821/installed). I can see that your app with an ID ending in **0930** is not connected to any HubSpot account at this time.

You can connect your app to an account through [this OAuth flow](https://developers.hubspot.com/docs/methods/oauth2/oauth2-quickstart).

---

<div class="post-metadata">

**Author:** ![narainsagar](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/narainsagar/32/48165_2.png) [@narainsagar](https://community.hubspot.com/u/narainsagar)\
**Post date:** [October 4, 2019, 12:52pm UTC](https://community.hubspot.com/t/webhook-test-returns-500-error/16391/13 "2019-10-04T12:52:01Z")

</div>

Alright @IsaacTakushi Thanks, I’ll implement this OAuth flow and will let you know if I still get any issues.

Thanks for your help, I’m accepting your post reply as solution.
