APIs & Integrations

KarryCBB
Contributor

Hubspot Posting Contacts to Velocify

Hello!
I am so sorry to ask this but I have searched and searched and can not find the answer in the forums. I need to send my JSON schema to Velocify so they can help me set up the integration so a contact will automatically be posted to leads in Velocify. Where do I find my JSON Schema? I finally found the part that says webhooks can only send JSON formatted data. I’ve been trying POST and GET for weeks! Any help would be greatly appreciated.
-Karry
(I’m not a developer, but I play one on TV)

0 Upvotes
8 Replies 8
caseywise
Member

Hubspot Posting Contacts to Velocify

This might be a ghetto answer but I pieced the POSTed JSON schema together by pointing my workflow webhook at a PHP I have control over. What this script does.

  1. Decodes and formats/indents the JSON.
  2. Prepends the output with all headers, authentication and a time/date stamp.
  3. Appends to the text file (I’m calling it webhook.txt) so you can watch it live with tail -f live

<?php
$inputJSON = file_get_contents('php://input');
$inputJSON = json_encode(json_decode($inputJSON), JSON_PRETTY_PRINT);

$date = new DateTime();
$offsetEST = new DateInterval('PT1H');
$date->add($offsetEST);

$headers = "::: HEADERS :::\n";
$headers .= "username: ". $_SERVER['PHP_AUTH_USER']."\n";
$headers .= "password: ". $_SERVER['PHP_AUTH_PW']."\n";
foreach (getallheaders() as $name => $value) {
    echo "$name: $value\n";
    $headers .= $name.": ".$value."\n";
}

$txt = "-----------" .$date->format('m/d/Y H:i:s'). "\n";
$txt .= $headers;
$txt .= "::: BODY :::\n";
$txt .= $inputJSON;
$myfile = file_put_contents('webhook.txt', $txt.PHP_EOL , FILE_APPEND | LOCK_EX);
?>
0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Hubspot Posting Contacts to Velocify

Hi @kbrothers,

I’m not sure what the rep is talking about when they say they need a ‘post string’. The data that you see in RequestBin is send in the POST body whenever a contact reaches the webhook step in the workflow. Keep in mind that only properties that have a value will be included in the POST body, so it’s possible some of these values might be missing (since they don’t exist on the contact record). It’d be helpful to know how Velocify is handling the request body; the request is being sent successfully, and I can’t say what’s happening on their side.

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Hubspot Posting Contacts to Velocify

Hi @kbrothers,

The contact data is sent in the POST request body, so you shouldn’t be including any query parameters that aren’t required by Velocify. Using RequestBin (a tool to receive and view requests), I can see that the workflow is correctly sending POST data, which is formatted according to the structure of the following article. You can check out the article and RequestBin for what data is contained in the response. Steps for testing using RequestBin are in the following article as well.

How do I use webhooks with HubSpot workflows?

Learn how you can use the trigger a webhook action in HubSpot workflows.

https://requestb.in/16zu5fu1?inspect

0 Upvotes
KarryCBB
Contributor

Hubspot Posting Contacts to Velocify

Okay great! At least I was on the right track! I had done all of the above including the RequestBin, and I went through all the data returned - unfortunately there is so much it was truncated so I’m not sure past a certain point. BUT firstname and lastname were shown in there before it got cut off so at least I know I was posting the right data. Although the rep keeps telling me I need a post string - he says that he’s not seeing it show up when it posts - which give us a slight clue as to why a lead is showing up blank in Velocify. ( This is the way the Velocify rep mapped the variables but I can’t get anything to show up in velocify except the Campaign ID which is appended to the posting URL - and at least firstname & lastname should be in there. variables

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Hubspot Posting Contacts to Velocify

Hi @kbrothers,

Can you send me a link to the workflow you’re referring to?

0 Upvotes
KarryCBB
Contributor

Hubspot Posting Contacts to Velocify

0 Upvotes
KarryCBB
Contributor

Hubspot Posting Contacts to Velocify

Hi @Derek_Gervais! Thank you so much for replying! Yes I’ve read that article over and over. I think managed to send the correct schema to Velocify and they set it up and sent me back a posting URL. I made a workflow and triggered a webhook and tried both POST and GET options. That sent a request but didn’t post the data. So I tried appending property=firstname etc etc to the posting URL and that just posted the word “firstname” etc etc to Velocify.

So then I went to the API and tried putting it in a webhook over there and I just can’t figure out what to put in the template header! I tried this:
{
“firstname”: “contact.firstname”,
“lastname”: “contact.lastname”,
“email”: “contact.email”,
“phone”: “contact.phone”,
“mobilephone”: “contact.mobilephone”
}

and this:

{
“firstname”: “firstname”,
“lastname”: “lastname”,
“email”: “email”,
“phone”: “phone”,
“mobilephone”: “mobilephone”
}

I tried putting the posting URL in the Data Fetch RPI in the CRM extensions API and checking the “contacts” checkbox, I tried mapping properties, I’m just stumped :frowning:

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Hubspot Posting Contacts to Velocify

Hi @kbrothers,

Are you using the webhooks feature in workflows? If so, the following article has information on what data is sent by a POST request.

0 Upvotes