# 3rd Party Data retrieval

**URL:** <https://forum.kintone.dev/t/3rd-party-data-retrieval/71>\
**Category:** General\
**Created:** [June 5, 2017, 8:32am UTC](https://forum.kintone.dev/t/3rd-party-data-retrieval/71 "2017-06-05T08:32:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 5, 2017, 8:32am UTC](https://forum.kintone.dev/t/3rd-party-data-retrieval/71/1 "2017-06-05T08:32:12Z")

</div>

Hi, I have made a custom code using ajax and i wanted to retrieve the data from my kintone app. is there something missing or wrong with my code? I can’t seem to find it and I’m stuck here for 3 days already.

Thank you

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 6, 2017, 1:12am UTC](https://forum.kintone.dev/t/3rd-party-data-retrieval/71/2 "2017-06-06T01:12:46Z")

</div>

\> No Access-Control-Allow-Origin header is present on the requested resource. Origin ‘xxxx’ is therefore not allowed access.

&nbsp;

As shown in console, kintone doesn’t allow access from other subdomain.

So, you have to use [“kintone.proxy()”](https://forum.kintone.dev/hc/en-us/articles/213148917/) if you want to access to other services or domains as follows.

&nbsp;

var url = ‘[https://hogehoge.kintone.com/k/v1/records.json](https://hogehoge.kintone.com/k/v1/records.json)’;

var method = ‘POST’;

var headers = {

&nbsp; ‘Content-Type’:‘application/json’,

&nbsp; ‘X-Cybozu-API-Token’:‘apitoken’,

&nbsp; ‘X-HTTP-Method-Override’:‘GET’

};

var params = {

&nbsp; app:54

};

kintone.proxy(url, method, headers, params).then(function(r){

&nbsp; console.log(r);

}).catch(function(e){

&nbsp; console.log(e);

});

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 6, 2017, 2:31am UTC](https://forum.kintone.dev/t/3rd-party-data-retrieval/71/3 "2017-06-06T02:31:55Z")

</div>

Hi,&nbsp;Ryu Yamashita

Thank you for the response but i need to get the records from outside kintone. as of now I am using virtual host of xampp, I’m creating a website from scratch. is that possible to fetch them through Ajax?

Thank you.

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 6, 2017, 2:55am UTC](https://forum.kintone.dev/t/3rd-party-data-retrieval/71/4 "2017-06-06T02:55:28Z")

</div>

If the global IP address or DNS is assigned to your website, you can access to your site through&nbsp;“kintone.proxy()” as well.

I think you have to set [“Access-Control-Allow-Origin”](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) into XAMPP if you want to access via ajax though I’m not familiar with XAMPP.

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 6, 2017, 3:23am UTC](https://forum.kintone.dev/t/3rd-party-data-retrieval/71/5 "2017-06-06T03:23:14Z")

</div>

how will my program (scratch website using html, css, javascript) use the “kintone.proxy()” method? here are some of the errors that I have encountered and also the code

![](https://developer.kintone.io/hc/user_images/rbIQ36go6EesV0xvTJgDqw.png)

![](https://developer.kintone.io/hc/user_images/q8tboAZd2uLms2uiiaZ3Og.png)

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 6, 2017, 4:03am UTC](https://forum.kintone.dev/t/3rd-party-data-retrieval/71/6 "2017-06-06T04:03:28Z")

</div>

German, where are you executing this code from?

I think Ryu pointed out a solution that would only work&nbsp;if you were&nbsp;executing from kintone Domain A to get data from kintone Domain B  
(the kintone.proxy() method can only be used inside the kintone domain)

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 6, 2017, 5:10am UTC](https://forum.kintone.dev/t/3rd-party-data-retrieval/71/7 "2017-06-06T05:10:10Z")

</div>

Hi, Akira

I’m executing this code from a scratch application.

languages used:  
HTML5  
CSS3  
Javascript

Here is the dir of my project for you to get familiar with

Root Folder  
 ![](https://developer.kintone.io/hc/user_images/jGs0W5YF6kgmeyxhv2oR5Q.png)

CSS folder  
 ![](https://developer.kintone.io/hc/user_images/BzOtxXMiDJ_nRZVJNasX9w.png)

JS folder  
 ![](https://developer.kintone.io/hc/user_images/lS-JDmOxWJMDjyZCF993tg.png)  
Do you think this is possible? one more thing. my Project Manager wanted to use AWS (Amazon Web Services) but as of now we doesn’t have an account for that and he told me to study how to Insert, Delete, Update on kintone externally using their API for our future projects and also what I’m doing right now is for one of our client.

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 6, 2017, 10:25am UTC](https://forum.kintone.dev/t/3rd-party-data-retrieval/71/8 "2017-06-06T10:25:50Z")

</div>

Sorry. I think I misunderstood as Akira pointed out.

&nbsp;

Generally, webpages can’t access to other pages or APIs while you use JavaScript. [“Access-Control-Allow-Origin”](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)&nbsp; needs to be set in&nbsp;the API received side via JavaScript. That condition is also called cross domain restriction. kintone denies cross-domain access as well.

&nbsp;

On the other hand, as your project manager said, you can access from your website to kintone with JavaScript if you use Amazon API Gateway and AWS Lambda. You can control&nbsp;[“Access-Control-Allow-Origin”](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin)&nbsp;in API Gateway.

This page show the sample settings and codes though it is in Japanse.

[http://qiita.com/ha\_ru\_ma\_ki/items/ccb7c535d8ef1b255365](http://qiita.com/ha_ru_ma_ki/items/ccb7c535d8ef1b255365)

---

<div class="post-metadata">

**Author:** ![legacy\_user](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/legacy_user/32/25_2.png) [@legacy\_user](https://forum.kintone.dev/u/legacy_user)\
**Post date:** [June 7, 2017, 2:24am UTC](https://forum.kintone.dev/t/3rd-party-data-retrieval/71/9 "2017-06-07T02:24:39Z")

</div>

Thank you for the support, Mr. Ryu Yamashita and Mr. Akira

I’m really satisfied with the service. I have solved my problems as of now, after getting the AWS account that my Project Manager wants to order and if I have questions I would love to have a conversation again regarding Kintone matters and for our future projects. Again, Thank you for the warm response ^^

Cheers,  
German L. Manalili
