Answers.Body: <p>I would say you would need to create a custom plugin and use <a href="http://developers.hubspot.com/docs/methods/workflows/webhook_information" rel="nofollow">Hubspot webhooks</a>.</p>
  
  <p>Within this plugin you would have a controller method that, when you visit the action url, will take a response and convert it to an entry.</p>
  
  <p>So for example if your plugin was called <code>hubspotentries</code>, you could have a controller <code>HubspotEntries_WebhookController.php</code></p>
  
  <p>Then inside that:</p>
  
  <pre><code>&lt;?php
  namespace Craft;
  
  class HubspotEntries_WebhookController extends BaseController {
  
   protected $allowAnonymous = true;
  
  
   public function actionSync()
   {
  
     // If the webhook POSTS to the action url, get the php input and decode it
     $webhook = json_decode(file_get_contents('php://input'), true);
  
     //....Go through webhook and save entries etc.
  
   }
  }
  </code></pre>
  
  <p>Your action url would be something like <code>http://domain.com/actions/hubspotEntries/webhook/sync</code></p>
  
  <p>You can then give this url to Hubspot and set up it so when an event occurs, they will POST or GET to this url and you'll be able to create the entries. I did something similar to this before (not hubspot but another service) and it works like a charm.</p>
  
  <p><strong>Useful Craft Documentation links</strong>  </p>
  
  <p><a href="http://buildwithcraft.com/docs/plugins/introduction" rel="nofollow">Plugin development introduction</a><br>
  <a href="http://buildwithcraft.com/docs/plugins/controllers" rel="nofollow">Controllers in plugins</a></p>
  
  <p><strong>Hubspot Help</strong>   </p>
  
  <p><a href="http://help.hubspot.com/articles/KCS_Article/Workflows/How-do-I-use-webhooks-with-HubSpot-Workflows" rel="nofollow">How do I use webhooks with HubSpot Workflows</a></p>
  
  <p>Hope that helps you get started!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-19T18:40:33.717Z
Answers.Text: Wow, thank you very much! You have been an awesome help here. Really appreciate it!
Answers.UserDisplayName: Matteo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-20T12:05:05.597Z
Answers.Text: Not a problem :)
Answers.UserDisplayName: Alec Ritson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-18T08:58:38.990Z
Answers.LastActivityDate: 2015-08-18T17:32:12.230Z
Answers.LastEditDate: 2015-08-18T17:32:12.230Z
Answers.UserDisplayName: Alec Ritson
Body: <p>For a big client we are required to set up their blog on their Hubspot account. However we are developing everything else in Craft.</p>
  
  <p>What is the easiest way to make the connection so the client can use Hubspot to post blog entries into our Craft site?</p>
  
Tags: <templating><entries><relations>
Title: How to integrate with Hubspot
ThreadText: # How to integrate with Hubspot
  
  (Asked by: username_0 on 2015-08-14)
  
  For a big client we are required to set up their blog on their Hubspot account. However we are developing everything else in Craft.
  
  What is the easiest way to make the connection so the client can use Hubspot to post blog entries into our Craft site?
  
  **Tags:** templating, entries, relations
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-08-18. Score: 5 | Accepted answer
  
  I would say you would need to create a custom plugin and use [Hubspot webhooks](http://developers.hubspot.com/docs/methods/workflows/webhook_information).
  
  Within this plugin you would have a controller method that, when you visit the action url, will take a response and convert it to an entry.
  
  So for example if your plugin was called `hubspotentries`, you could have a controller `HubspotEntries_WebhookController.php`
  
  Then inside that:
  
  ```
  <?php
  namespace Craft;
  
  class HubspotEntries_WebhookController extends BaseController {
  
   protected $allowAnonymous = true;
  
   public function actionSync()
   {
  
     // If the webhook POSTS to the action url, get the php input and decode it
     $webhook = json_decode(file_get_contents('php://input'), true);
  
     //....Go through webhook and save entries etc.
  
   }
  }
  
  ```
  
  Your action url would be something like `http://domain.com/actions/hubspotEntries/webhook/sync`
  
  You can then give this url to Hubspot and set up it so when an event occurs, they will POST or GET to this url and you'll be able to create the entries. I did something similar to this before (not hubspot but another service) and it works like a charm.
  
  **Useful Craft Documentation links**
  
  [Plugin development introduction](http://buildwithcraft.com/docs/plugins/introduction)  
  [Controllers in plugins](http://buildwithcraft.com/docs/plugins/controllers)
  
  **Hubspot Help**
  
  [How do I use webhooks with HubSpot Workflows](http://help.hubspot.com/articles/KCS_Article/Workflows/How-do-I-use-webhooks-with-HubSpot-Workflows)
  
  Hope that helps you get started!
  
  > **Comments:**
  > **username_0**: Wow, thank you very much! You have been an awesome help here. Really appreciate it!  
  > **username_1**: Not a problem :)  
  
  ---
  
  