# Webhook

**URL:** <https://community.hubspot.com/t/webhook/25441>\
**Category:** APIs & Integrations\
**Tags:** webhooks\
**Created:** [September 14, 2020, 3:55pm UTC](https://community.hubspot.com/t/webhook/25441 "2020-09-14T15:55:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sujatabh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sujatabh/32/33328_2.png) [@sujatabh](https://community.hubspot.com/u/sujatabh)\
**Post date:** [September 14, 2020, 3:55pm UTC](https://community.hubspot.com/t/webhook/25441/1 "2020-09-14T15:55:34Z")

</div>

How to get the JSOn inside the function of the url which I have provided for webhooks

---

<div class="post-metadata">

**Author:** ![Willson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/willson/32/84663_2.png) [@Willson](https://community.hubspot.com/u/Willson)\
**Post date:** [September 15, 2020, 10:27am UTC](https://community.hubspot.com/t/webhook/25441/2 "2020-09-15T10:27:44Z")

</div>

Hey @sujatabh,

Could you clarify what you’re trying to access? Are you trying to access data in HubSpot from a Webhook URL you’ve setup externally? If so, this is not possible, our Webhooks functionality only supports sending data FROM HubSpot to your external Webhook URL.

I hope this helps!

---

<div class="post-metadata">

**Author:** ![sujatabh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sujatabh/32/33328_2.png) [@sujatabh](https://community.hubspot.com/u/sujatabh)\
**Post date:** [September 15, 2020, 10:40am UTC](https://community.hubspot.com/t/webhook/25441/3 "2020-09-15T10:40:47Z")

</div>

![31698i8922FD7DE8D690AD.jpeg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/6/6616b8bdf4c6b6db7136af391915c681c9cf0b55.jpeg)

how to get this json inside the function of my side(external Webhook URL)

---

<div class="post-metadata">

**Author:** ![sujatabh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sujatabh/32/33328_2.png) [@sujatabh](https://community.hubspot.com/u/sujatabh)\
**Post date:** [September 23, 2020, 11:20am UTC](https://community.hubspot.com/t/webhook/25441/4 "2020-09-23T11:20:15Z")

</div>

I have followed some steps to integrate webhook :

Step 1- Created a workflow from the menu **Automation** that will be triggered when a contact will be created.

Step 2- Then choose **Trigger webhook** from \*\*Action.\*\*Put **Webhook url.**

Step 3- Write some method which will be triggered inside the provided webhook url.

It is triggerering my function when a contact is created.But as per your webhook document[u](https://knowledge.hubspot.com/workflows/how-do-i-use-webhooks-with-hubspot-workflows)[/u],

 ![31698i8922FD7DE8D690AD.jpeg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/6/6616b8bdf4c6b6db7136af391915c681c9cf0b55.jpeg)  
this type of JSON will be sent through webhook.How can I get it from my function and then want to decode it and use it for make a specific task for a contact.

---

<div class="post-metadata">

**Author:** ![Willson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/willson/32/84663_2.png) [@Willson](https://community.hubspot.com/u/Willson)\
**Post date:** [September 28, 2020, 10:07am UTC](https://community.hubspot.com/t/webhook/25441/5 "2020-09-28T10:07:29Z")

</div>

Hey @sujatabh,

As this data is sent externally to your Webhook URL, it is up to you to decide what method is best to convert this from JSON into a format you can work with when creating tasks.

I am unable to make any recommendations as I do not know how your external tool works or what codebase you’re working with. As such, you’ll need to work with your team to address this question.

---

<div class="post-metadata">

**Author:** ![satishjalan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/satishjalan/32/74736_2.png) [@satishjalan](https://community.hubspot.com/u/satishjalan)\
**Post date:** [September 28, 2020, 12:25pm UTC](https://community.hubspot.com/t/webhook/25441/6 "2020-09-28T12:25:59Z")

</div>

Hi Matthew,

We are integrating SMS API using Webhook API from Hubspot.

While executing the process, through a https page, we are not getting the json file.

However, we know the method to parse/convert it to fetch the data we need which needs to be sent to our SMS API.

So, for this, we created a test workflow, and triggered the webhook. As per the documentation, the https should receive the json file sent by the Hubspot. Now, the only question is that how to get this json file.

I hope, I have been able to make my query clear.

Sujata, works in my team.

---

<div class="post-metadata">

**Author:** ![sujatabh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sujatabh/32/33328_2.png) [@sujatabh](https://community.hubspot.com/u/sujatabh)\
**Post date:** [September 28, 2020, 3:42pm UTC](https://community.hubspot.com/t/webhook/25441/7 "2020-09-28T15:42:51Z")

</div>

It is solved from the reference URL- [https://community.hubspot.com/t5/APIs-Integrations/Webhook-JSON-Understanding-Extracting-Data/td-p/226257](https://community.hubspot.com/t5/APIs-Integrations/Webhook-JSON-Understanding-Extracting-Data/td-p/226257)

I have used the code -

$json = file\_get\_contents(‘php://input’);

// Converts it into a PHP object  
$json = json\_decode($json, true);  
//get lastname, firstname, email from array  
if(is\_array($json)){  
$lastname = $json[‘properties’][‘lastname’][‘value’];  
$firstname = $json[‘properties’][‘firstname’][‘value’];  
$mobilephone = $json[‘properties’][‘mobilephone’][‘value’];  
$email = $json[‘properties’][‘email’][‘value’];  
$vid = $json[‘vid’]; // vid; contact specific identifier  
}

and got the solution
