Web hook returns No response for my URL

companies
contacts

#1

1.My workflow name: vitalsware

2.This Image shows the content having empty string: It means it doesn’t receive any response from hubspot.

3.This is the webhook URL I used.

https://app2-dev.vitalsware.com/vitals/user_codeforhubspot.cfm

4.This is my piece of code for trying to get the JSON Response from Hubspot to My application.

<cfset HTTPRequestData = GetHttpRequestData()>
<cfdump var="#HTTPRequestData#" label="HTTP Request Data"> 
<cfoutput>
<b>Content:</b> #HTTPRequestData.content#
</cfoutput>

Content is empty.It means it doesn’t receive any message.But the workflow shows 5 contacts enrolled.But i didn’t receive any response.This image explains you all.

Then I tried to store the message in database.Message shows empty only.

<cfquery name="tempmessage" datasource="#session.datasource#">
INSERT INTO tempmessage (message) values ('#HTTPRequestData.content#')
</cfquery>

what Might be the issue.How to resolve it from our side.can you suggest Ideas.


#2

Hi @boopathi_s

This may be an issue with how ColdFusion is handling the JSON data we’d send in the POST request. When I manually try you URL with data from a contact record, I’m getting an error:

ByteArray objects cannot be converted to strings.
The error occurred in C:/inetpub/app2/vitals/user_codeforhubspot.cfm: line 702
700 : <cfdump var="#HTTPRequestData#" label="HTTP Request Data"> 
701 : <cfoutput>
702 : <b>Content:</b> #HTTPRequestData.content#
703 : </cfoutput>
704 : 

It seems like coldfusion treats the JSON as binary data instead of text, so you’ll need to deserialize the data first. The answer here might help: http://stackoverflow.com/a/5781521/2121330


#3

@dadams hey, bro i tried this code…

<cfset myData = deserializeJSON(ToString(getHTTPRequestData().content))>

If i put this code,then it shows json parsing error.The content returned is empty string.so it can’t be json.

Then i tried this:

<cfdump var = "#(ToString(getHTTPRequestData().content))#"> 

It shows the output: [empty string] .

So it means it doesn’t any provide JSON response.Is there any idea about this?


#4

@dadams Bro I Asked this two weeks ago…please help this out.


#5

Is your page storing the data from the webhook somewhere? Or are you seeing the data as empty when opening the page in your web browser? I’d expect the data to be empty when loading the page in a browser, since it would be making a GET request, so it wouldn’t have any data to print.

I’m seeing the JSON output when I manually POST to the URL:

Otherwise I’m still seeing an error further down the page:

Element DATASOURCE is undefined in SESSION.
The error occurred in C:/inetpub/app2/vitals/user_codeforhubspot.cfm: line 713
711 : </cfoutput> --->
712 : 
713 : <cfquery name="tempmessage" datasource="#session.datasource#">
714 : 				INSERT INTO tempmessage (message) values ('#HTTPRequestData.content#')
715 : 			</cfquery>

#6

@dadams Yeah Bro, Thanks for the reply. I am trying to store the data In my database.

Better, try this URL and reply ASAP what response you are getting.We have to proceed further.

https://app2-dev.vitalsware.com/vitals/user_testinbound.cfm?dsname=Vitals_52493

OR

https://app2-dev.vitalsware.com/vitals/user_testinbound.cfm

Thanks for reply bro.

Better refer this question too bro.


#7

Still seeing an error with either of those URLs:


#8

@dadams yeah bro…thanks for communication Bro.

Now I changed the code to

<cfquery name="privlog" datasource="#dsname#">
INSERT INTO tempmessage(message)
VALUES('Hubspot inbound :#(ToString(GetHTTPRequestData().Content))#')
</cfquery>  

I got response.Thanks A Lot bro.