# Why can't i get app, record with kintone.proxy?

**URL:** <https://forum.kintone.dev/t/why-cant-i-get-app-record-with-kintone-proxy/256>\
**Category:** General\
**Created:** [February 23, 2022, 9:21am UTC](https://forum.kintone.dev/t/why-cant-i-get-app-record-with-kintone-proxy/256 "2022-02-23T09:21:34Z")\
**Posts on this page:** 3\
**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:** [February 23, 2022, 9:21am UTC](https://forum.kintone.dev/t/why-cant-i-get-app-record-with-kintone-proxy/256/1 "2022-02-23T09:21:34Z")

</div>

I can use kintone.proxy with POST method (ex: add preview app, add form fields, …), but when i use them with get method, i received error (status: 502).&nbsp;

I use postmen to request Get method, it run correct.

Post:

```
let url = 'https:// *******.cybozu.com/k/v1/preview/app.json'
let method = 'POST'
let header = {
  'X-Cybozu-Authorization': ' ******',
  'Content-Type': 'application/json',
}

let data = {
  name: 'APP_NAME'
}

kintone.proxy(url, method, header, data, function(body, status, headers) {
  console.log(status, JSON.parse(body), headers);
}, function(error) {
  console.log(error); // Display the response body (string) from the proxy API
});

```

GET:&nbsp;

```
let url = 'https:// ***********.cybozu.com/k/v1/app.json'
let method = 'GET'
let header = {
  'X-Cybozu-Authorization': ' *********',
  'Content-Type': 'application/json'  
}

let data = {
  id: 113
}

kintone.proxy(url, method, header, data, function(body, status, headers) {
  console.log(body);
}, function(error) {
  console.log(error); // Display the response body (string) from the proxy API
});

```

Can you help me?

---

<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:** [February 25, 2022, 8:21pm UTC](https://forum.kintone.dev/t/why-cant-i-get-app-record-with-kintone-proxy/256/2 "2022-02-25T20:21:54Z")

</div>

Hi Tân Lương Nhật,

&nbsp;

I tested the process based on your provided information and found that the 502 error did not occur.

(Error 520 occurred on my end.)

&nbsp;

Also, when I checked the processing that specified the GET method you provided, I found an error in the way the kintone.proxy function is being used.

&nbsp;

For data, it is only used for the POST and PUT methods and ignored for the GET and DELETE methods.

For the GET and DELETE methods, you need to add a parameter to the QueryString of the URL.

&nbsp;

In the case of the GET method, it is not necessary to specify ‘Content-Type’: 'application/JSON within the header.

Could you check if it runs correctly by altering it to the following process?

&nbsp;

\<Ex\>

&nbsp;

(the app ID is specified in the URL.)

&nbsp;

```
let url = 'https:// ***********.cybozu.com/k/v1/app.json?id=113'
let method = 'GET'
let header = {
'X-Cybozu-Authorization': '' *********'
}

let data = {}

kintone.proxy(url, method, header, data, function(body, status, headers) {
console.log(body);
}, function(error) {
console.log(error); // Display the response body (string) from the proxy API
});
```

---

<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:** [February 28, 2022, 3:40am UTC](https://forum.kintone.dev/t/why-cant-i-get-app-record-with-kintone-proxy/256/3 "2022-02-28T03:40:57Z")

</div>

Thank Sean Tachibana,

My problem was resolved.&nbsp;

I inserted query to url as you said (‘https://\*\*\*\*\*\*\*\*\*\*\*.cybozu.com/k/v1/app.json?id=113’)&nbsp;

and I add to header authentication:

```
let header = {
'X-Cybozu-Authorization': ' *********',
'Authorization': ' *********'
}

```

Thank your support so much

&nbsp;

&nbsp;
