<?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 GET Contact by Email Address Via Client-Side AJAX Request in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/GET-Contact-by-Email-Address-Via-Client-Side-AJAX-Request/m-p/253500#M22459</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to get the contact by email address on the Client-Side of my page that I am creating via an AJAX GET Request. I am having some problems doing that. It appears to be returning a 200 response but throws a "parsererror". Does anyone have any clue what to do? It doesn't work with either the DEMO URL or my own URL with my own hapikey, they both return the same results. My code example is below. As well as the Response it gives and the URL to the API Documentation that I am referencing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/methods/contacts/get_contact_by_email" target="_self"&gt;https://developers.hubspot.com/docs/methods/contacts/get_contact_by_email&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$.ajax({
	method: 'get',
	crossDomain: true,
	url: 'https://api.hubapi.com/contacts/v1/contact/email/testingapis@hubspot.com/profile?hapikey=demo',
	headers: {
		'accept': 'application/json',
		'Access-Control-Allow-Origin':'*'
	},
	contentType: 'application/json; charset=utf-8',
	dataType: 'jsonp',
	processData: true,
	credentials: 'include',
	complete: function (jqXHR, textStatus) {
		console.log(jqXHR);
		console.log(JSON.parse(JSON.stringify(jqXHR)));
		console.log(textStatus);
	},
	error: function (jqXHR, textStatus, errorThrown) {
		console.log(jqXHR);
		console.log(jqXHR.status);
		console.log(textStatus);
		console.log(JSON.parse(JSON.stringify(textStatus)));
		console.log(errorThrown);
	}
});&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;U&gt;Error Callback&lt;/U&gt;&lt;BR /&gt;The script from “https://api.hubapi.com/contacts/v1/contact/email/testingapis@hubspot.com/profile?hapikey=demo&amp;amp;callback=jQuery33107534809487763269_1550251296155&amp;amp;_=1550251296156” was loaded even though its MIME type (“application/json”) is not a valid JavaScript MIME type.[Learn More]
Object { readyState: 4, getResponseHeader: getResponseHeader(), getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader: setRequestHeader(), overrideMimeType: overrideMimeType(), statusCode: statusCode(), abort: abort(), state: state(), always: always(), catch: catch()
, … }
200
parsererror
parsererror
Error: "jQuery33107534809487763269_1550251296155 was not called"
    jQuery 7&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;Complete Callback&lt;/U&gt;
Object { readyState: 4, getResponseHeader: getResponseHeader(), getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader: setRequestHeader(), overrideMimeType: overrideMimeType(), statusCode: statusCode(), abort: abort(), state: state(), always: always(), catch: catch()
, … }
Object { readyState: 4, status: 200, statusText: "load" }
parsererror
SyntaxError: unexpected token: ':'[Learn More]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Response headers (159 B)	
access-control-allow-credentials: false
cf-ray: 4a998491284d9f72-IAD
content-encoding: br
content-type: application/json;charset=utf-8
date: Fri, 15 Feb 2019 17:33:08 GMT
expect-ct: max-age=604800, report-uri="ht….com/cdn-cgi/beacon/expect-ct"
server: cloudflare
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: Accept-Encoding
vary: Accept-Encoding
X-Firefox-Spdy: h2
x-hubspot-ratelimit-daily: 160000
x-hubspot-ratelimit-daily-remaining: 116395
x-hubspot-ratelimit-secondly: 60
x-hubspot-ratelimit-secondly-remaining: 59
x-trace: 2B1750502C32EBB7DD88D989AD3F05B2F1A5BD8B32000000000000000000
&lt;BR /&gt;Request headers (0.977 KB)
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
Cookie: __cfduid=d5833bca87f634ab03bd9…8d5ec6375edd376798-1550246991
Host: api.hubapi.com
Referer: http://127.0.0.1:8000/
User-Agent: Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/66.0&lt;/PRE&gt;</description>
    <pubDate>Fri, 15 Feb 2019 17:44:15 GMT</pubDate>
    <dc:creator>Dinder</dc:creator>
    <dc:date>2019-02-15T17:44:15Z</dc:date>
    <item>
      <title>GET Contact by Email Address Via Client-Side AJAX Request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/GET-Contact-by-Email-Address-Via-Client-Side-AJAX-Request/m-p/253500#M22459</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to get the contact by email address on the Client-Side of my page that I am creating via an AJAX GET Request. I am having some problems doing that. It appears to be returning a 200 response but throws a "parsererror". Does anyone have any clue what to do? It doesn't work with either the DEMO URL or my own URL with my own hapikey, they both return the same results. My code example is below. As well as the Response it gives and the URL to the API Documentation that I am referencing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.hubspot.com/docs/methods/contacts/get_contact_by_email" target="_self"&gt;https://developers.hubspot.com/docs/methods/contacts/get_contact_by_email&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$.ajax({
	method: 'get',
	crossDomain: true,
	url: 'https://api.hubapi.com/contacts/v1/contact/email/testingapis@hubspot.com/profile?hapikey=demo',
	headers: {
		'accept': 'application/json',
		'Access-Control-Allow-Origin':'*'
	},
	contentType: 'application/json; charset=utf-8',
	dataType: 'jsonp',
	processData: true,
	credentials: 'include',
	complete: function (jqXHR, textStatus) {
		console.log(jqXHR);
		console.log(JSON.parse(JSON.stringify(jqXHR)));
		console.log(textStatus);
	},
	error: function (jqXHR, textStatus, errorThrown) {
		console.log(jqXHR);
		console.log(jqXHR.status);
		console.log(textStatus);
		console.log(JSON.parse(JSON.stringify(textStatus)));
		console.log(errorThrown);
	}
});&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;U&gt;Error Callback&lt;/U&gt;&lt;BR /&gt;The script from “https://api.hubapi.com/contacts/v1/contact/email/testingapis@hubspot.com/profile?hapikey=demo&amp;amp;callback=jQuery33107534809487763269_1550251296155&amp;amp;_=1550251296156” was loaded even though its MIME type (“application/json”) is not a valid JavaScript MIME type.[Learn More]
Object { readyState: 4, getResponseHeader: getResponseHeader(), getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader: setRequestHeader(), overrideMimeType: overrideMimeType(), statusCode: statusCode(), abort: abort(), state: state(), always: always(), catch: catch()
, … }
200
parsererror
parsererror
Error: "jQuery33107534809487763269_1550251296155 was not called"
    jQuery 7&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;Complete Callback&lt;/U&gt;
Object { readyState: 4, getResponseHeader: getResponseHeader(), getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader: setRequestHeader(), overrideMimeType: overrideMimeType(), statusCode: statusCode(), abort: abort(), state: state(), always: always(), catch: catch()
, … }
Object { readyState: 4, status: 200, statusText: "load" }
parsererror
SyntaxError: unexpected token: ':'[Learn More]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Response headers (159 B)	
access-control-allow-credentials: false
cf-ray: 4a998491284d9f72-IAD
content-encoding: br
content-type: application/json;charset=utf-8
date: Fri, 15 Feb 2019 17:33:08 GMT
expect-ct: max-age=604800, report-uri="ht….com/cdn-cgi/beacon/expect-ct"
server: cloudflare
strict-transport-security: max-age=31536000; includeSubDomains; preload
vary: Accept-Encoding
vary: Accept-Encoding
X-Firefox-Spdy: h2
x-hubspot-ratelimit-daily: 160000
x-hubspot-ratelimit-daily-remaining: 116395
x-hubspot-ratelimit-secondly: 60
x-hubspot-ratelimit-secondly-remaining: 59
x-trace: 2B1750502C32EBB7DD88D989AD3F05B2F1A5BD8B32000000000000000000
&lt;BR /&gt;Request headers (0.977 KB)
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
Cookie: __cfduid=d5833bca87f634ab03bd9…8d5ec6375edd376798-1550246991
Host: api.hubapi.com
Referer: http://127.0.0.1:8000/
User-Agent: Mozilla/5.0 (Windows NT 10.0; …) Gecko/20100101 Firefox/66.0&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Feb 2019 17:44:15 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/GET-Contact-by-Email-Address-Via-Client-Side-AJAX-Request/m-p/253500#M22459</guid>
      <dc:creator>Dinder</dc:creator>
      <dc:date>2019-02-15T17:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: GET Contact by Email Address Via Client-Side AJAX Request</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/GET-Contact-by-Email-Address-Via-Client-Side-AJAX-Request/m-p/255431#M22694</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/86842"&gt;@Dinder&lt;/a&gt;&amp;nbsp;, our APIs do not support client side calls aside from the Forms V3 API, and the GET methods for HubDB:&amp;nbsp;&lt;A href="https://developers.hubspot.com/docs/faq/do-hubspot-apis-support-ajax-request" target="_blank"&gt;https://developers.hubspot.com/docs/faq/do-hubspot-apis-support-ajax-request&lt;/A&gt;. You'll have to make your requests server-side&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 22:09:32 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/GET-Contact-by-Email-Address-Via-Client-Side-AJAX-Request/m-p/255431#M22694</guid>
      <dc:creator>cbarley</dc:creator>
      <dc:date>2019-02-25T22:09:32Z</dc:date>
    </item>
  </channel>
</rss>

