<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Timeline API - using Ajax in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222183#M1079</link>
    <description>&lt;P&gt;If I try without hapikey .... I get below error&lt;/P&gt;
&lt;P&gt;{"status":"error","message":"Any of the listed authentication credentials are missing","correlationId"&lt;/P&gt;
&lt;P&gt;and If I use hapikey, userid I dont get this error..&lt;/P&gt;
&lt;P&gt;I tried 3 combination ... in place of appid ...&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;I tried both dev&lt;/LI&gt;
&lt;LI&gt;and non-dev account and error is same.&lt;/LI&gt;
&lt;LI&gt;Even tried removing "Bearer" from Authorization header&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;but error is same .&lt;/P&gt;
&lt;P&gt;Is there anything to do with event created manually in dev account ?&lt;/P&gt;
&lt;P&gt;You can response here&lt;BR /&gt;
&lt;A href="https://290px.com/app/oauth.php" class="onebox" target="_blank" rel="nofollow noopener"&gt;https://290px.com/app/oauth.php&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Oct 2018 18:40:42 GMT</pubDate>
    <dc:creator>socialpilgrim</dc:creator>
    <dc:date>2018-10-09T18:40:42Z</dc:date>
    <item>
      <title>Timeline API - using Ajax</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222177#M1073</link>
      <description>&lt;P&gt;Hey I am trying to add timeline on form submit using ajax request thru javascript,&lt;/P&gt;
&lt;P&gt;Flow -&amp;gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Form submit ( redirects to another form)&lt;/LI&gt;
&lt;LI&gt;capture user details&lt;/LI&gt;
&lt;LI&gt;call timeline api event to create timeline ( using javascript)&lt;/LI&gt;
&lt;LI&gt;redirect to external url ( using javascript)&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;at step 3 I am getting below error&lt;/P&gt;
&lt;P&gt;{"status":"error","message":"You don't have access to this application.","correlationId":"46861cf4-64fa-425a-8a26-89aaffe78622","requestId":"47bed49c290f7553acdbc61c28c02956"}&lt;/P&gt;
&lt;P&gt;How I can check I where I am doing wrong like access related details ?&lt;/P&gt;
&lt;P&gt;Already checked with hubspot guys, but seems no issue on permission end&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 11:19:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222177#M1073</guid>
      <dc:creator>socialpilgrim</dc:creator>
      <dc:date>2018-10-04T11:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Timeline API - using Ajax</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222178#M1074</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/rajputsushil"&gt;@rajputsushil&lt;/A&gt;, The issue here is that timeline events cannot be created using ajax. Please see this article: &lt;A href="https://developers.hubspot.com/docs/faq/do-hubspot-apis-support-ajax-request"&gt;https://developers.hubspot.com/docs/faq/do-hubspot-apis-support-ajax-request&lt;/A&gt;. In order to create timeline events via the timeline api, you'll need to create a &lt;A href="https://developers.hubspot.com/"&gt;developer portal&lt;/A&gt;, and then create an App via OAuth inside your developer portal.&lt;/P&gt;
&lt;P&gt;That said, when a contact submits a form there should be a section on that contact's timeline related to a submission, like this: &lt;A href="http://prntscr.com/l26nlr"&gt;http://prntscr.com/l26nlr&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Why are you looking to create a timeline event after a form submission?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 15:38:05 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222178#M1074</guid>
      <dc:creator>cbarley</dc:creator>
      <dc:date>2018-10-04T15:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Timeline API - using Ajax</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222179#M1075</link>
      <description>&lt;P&gt;Hi Connor,&lt;BR /&gt;
Thanks for the reply .... I could see this is new for me, I had developer account and I was able to use api to get access to event type.&lt;/P&gt;
&lt;P&gt;But not sure how I use this to create timline in contact .... means how to link both dev and other(non-developer) account, since timeline is not in other(non-developer) account.&lt;/P&gt;
&lt;P&gt;I tried (non-developer) account appid, myuser id and my hapikey but no access...&lt;/P&gt;
&lt;P&gt;What is the way forward ?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 06:33:37 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222179#M1075</guid>
      <dc:creator>socialpilgrim</dc:creator>
      <dc:date>2018-10-05T06:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Timeline API - using Ajax</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222180#M1076</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/rajputsushil"&gt;@rajputsushil&lt;/A&gt;, do you have a test account? &lt;A href="https://developers.hubspot.com/docs/faq/how-do-i-create-a-test-portal"&gt;https://developers.hubspot.com/docs/faq/how-do-i-create-a-test-portal&lt;/A&gt;. The root of the issue you're seeing is that Developer Portals and normal/test portals is that Developer Portals do not and cannot have any of those tools in them. To test how an application would work with a live portal, we'd either use a live portal if you have one, or create a test portal as I stated above.&lt;/P&gt;
&lt;P&gt;If you create a test portal, you should be able to go into that and either create some contacts to test the timeline API on, or create a timeline event on an existing contact if you have them. You'll need the grant the application authorization to that test portal by going through the &lt;A href="https://developers.hubspot.com/docs/methods/oauth2/oauth2-overview"&gt;OAuth flow&lt;/A&gt; before you can submit a Timeline Event. Make sure you read the Prerequisites section in &lt;A href="https://developers.hubspot.com/docs/methods/timeline/timeline-overview"&gt;this article&lt;/A&gt; before you jump into creating timeline events&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 15:46:26 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222180#M1076</guid>
      <dc:creator>cbarley</dc:creator>
      <dc:date>2018-10-05T15:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Timeline API - using Ajax</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222181#M1077</link>
      <description>&lt;P&gt;Hi connor .... thanks for the reply, I am able to test with account and dev account and getting access_token&lt;/P&gt;
&lt;P&gt;$hubEventUrl.  = "&lt;A href="https://api.hubapi.com/integrations/v1/" rel="nofollow noopener"&gt;https://api.hubapi.com/integrations/v1/&lt;/A&gt;&amp;lt;&amp;lt;&amp;gt;&amp;gt;/timeline/event?hapikey="&amp;lt;&amp;lt;&amp;gt;&amp;amp;userId=&amp;lt;&amp;lt;&amp;gt;&amp;gt;";&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;$re = $_SESSION["result"];
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;// here portalId= non dev account id&lt;BR /&gt;
//eventTypeId = already created in dev account with 2 properties, emailid, sessionid&lt;BR /&gt;
//email[support@xxxxx.com] = already present in non dev account as contact&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;	$json = '{"id": "'.$_SESSION["portalId"].'", "eventTypeId":"380358","email":"support@xxxxx.com"}';
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;// I havent got Bearer token so I am using access_token below&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;	$headers = array();
	$headers[] = "Content-Type: application/json";
	$headers[] = "Authorization: Bearer ".$re["access_token"];	
			
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $hubEventUrl);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
	curl_setopt($ch, CURLOPT_POSTFIELDS,$json);
	curl_setopt($ch, CURLOPT_POST, 3);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

	$xjson = curl_exec($ch);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;On execution if this I am not getting any response and not even Timeline is created for contact &lt;A&gt;"support@xxxxx.com&lt;/A&gt;".&lt;/P&gt;
&lt;P&gt;Not sure what is I am missing here.&lt;/P&gt;
&lt;P&gt;You can test code here -&amp;gt;&lt;BR /&gt;
&lt;A href="https://290px.com/app/oauth.php" rel="nofollow noopener"&gt;https://290px.com/app/oauth.php&lt;/A&gt;, provide any hubid....&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 12:59:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222181#M1077</guid>
      <dc:creator>socialpilgrim</dc:creator>
      <dc:date>2018-10-09T12:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Timeline API - using Ajax</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222182#M1078</link>
      <description>&lt;P&gt;Hi &lt;A class="mention" href="https://community.hubspot.com/u/rajputsushil"&gt;@rajputsushil&lt;/A&gt;, that doesn't look like the correct URL. You should be making a PUT request to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class="lang-auto"&gt;https://api.hubapi.com/integrations/v1/&amp;lt;&amp;lt;applicationId&amp;gt;&amp;gt;/timeline/event
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hapikey shouldn't be present to create a timeline event. you'd only need the developer portal's hapikey if you were making a GET request to see all timeline events that you'd created. The specifics of creating a timeline event are here: &lt;A href="https://developers.hubspot.com/docs/methods/timeline/create-or-update-event"&gt;https://developers.hubspot.com/docs/methods/timeline/create-or-update-event&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 14:02:08 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222182#M1078</guid>
      <dc:creator>cbarley</dc:creator>
      <dc:date>2018-10-09T14:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Timeline API - using Ajax</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222183#M1079</link>
      <description>&lt;P&gt;If I try without hapikey .... I get below error&lt;/P&gt;
&lt;P&gt;{"status":"error","message":"Any of the listed authentication credentials are missing","correlationId"&lt;/P&gt;
&lt;P&gt;and If I use hapikey, userid I dont get this error..&lt;/P&gt;
&lt;P&gt;I tried 3 combination ... in place of appid ...&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;I tried both dev&lt;/LI&gt;
&lt;LI&gt;and non-dev account and error is same.&lt;/LI&gt;
&lt;LI&gt;Even tried removing "Bearer" from Authorization header&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;but error is same .&lt;/P&gt;
&lt;P&gt;Is there anything to do with event created manually in dev account ?&lt;/P&gt;
&lt;P&gt;You can response here&lt;BR /&gt;
&lt;A href="https://290px.com/app/oauth.php" class="onebox" target="_blank" rel="nofollow noopener"&gt;https://290px.com/app/oauth.php&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 18:40:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222183#M1079</guid>
      <dc:creator>socialpilgrim</dc:creator>
      <dc:date>2018-10-09T18:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Timeline API - using Ajax</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222184#M1080</link>
      <description>&lt;P&gt;Hey Connor .... thanks for the support, I am able to create event now.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;new test&lt;/STRONG&gt;  had Demo.ja.sg event&lt;BR /&gt;
&lt;STRONG&gt;Registered for &lt;A href="https://mywebinarsystem/webinar/%7Bsessionid%7D" rel="nofollow noopener"&gt;admin@tzone.com&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 14:04:27 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/Timeline-API-using-Ajax/m-p/222184#M1080</guid>
      <dc:creator>socialpilgrim</dc:creator>
      <dc:date>2018-10-10T14:04:27Z</dc:date>
    </item>
  </channel>
</rss>

