Hello @kokonuts
I was able to reproduce this with a similar setup.
There appear to be two separate issues in the sample code.
First, when using kintone.proxy() with a GET request, the fourth data parameter is ignored. Because of this, the app value in params is not being sent to the Get Records API.
In my test, using:
const response = await kintone.proxy(
url,
'GET',
headers,
params
);
resulted in an HTTP 400 response indicating that the required app parameter was missing.
Instead, include the App ID in the query string:
const url =
`${mykintone}/k/v1/records.json?app=${mykintone_APP_ID}`;
Then call:
const response = await kintone.proxy(
url,
'GET',
headers,
{}
);
Also, there is a typo here:
console.log(repsonse);
It should be:
console.log(response);
In my test, the typo resulted in:
ReferenceError: repsonse is not defined
One other thing to note is that the Promise version of kintone.proxy() returns an array containing the response body, HTTP status code, and response headers:
console.log(response[0]); // response body
console.log(response[1]); // HTTP status
console.log(response[2]); // response headers
If you want to access the returned records, you can parse the response body:
const data = JSON.parse(response[0]);
console.log(data.records);
I hope this helps.
References: