Dear All,
I am new to Kintone. I have a Kintone App with the following fields that I want to display on a PHP file: field_A, サービス内容, 一般料金(ルピア)【一覧】
My script:
<?php
$query =$_POST['query'];
$subdomain = "INSERT_SUBDOMAIN_HERE"; // subdomain
$token = "INSERT_API_TOKEN_HERE";
$appId = "INSERT_APP_ID_HERE"; // App ID of product app
$url="https://INSERT_SUBDOMAIN_HERE.cybozu.com/k/v1/record.json?app=18&id=1";
$subdomain = "INSERT_SUBDOMAIN_HERE"; // subdomain
// Set HTTP header to send to server
$options = array (
'http' => array (
'method' => 'GET',
'header' => "X-Cybozu-API-Token:". $token. "r "
)
);
$buildQuery = http_build_query (array ("app" => $appId, "query" => $query), "", "&");
// create context
$context = stream_context_create ($options);
// Connect to the server and get data
//$contents = file_get_contents ('https: //'.$subdomain.'.cybozu.com/k/v1/records.json?'.$buildQuery, FALSE, $context);
$contents = file_get_contents( 'https://'.$subdomain.'.cybozu.com/k/v1/records.json?'.htmlspecialchars_decode($buildQuery), FALSE, $context );
$data = json_decode ($contents, true);
echo json_encode ($data ["records"]);
echo $data;
?>