私はRESTで新しく、ROQLを使用してクエリSELECT ID from CO.A_Country where Name="xxx";
からIDのみを取得しようとしています。私はPHPでRESTを使用しています:PHPでREST GETリクエストからIDを取得する - Oracle Right Now
<?php
/**
* Example API call
* GET profile information
*/
// the ID of the profile
$profileID = 2;
// the token
$token = 'your token here';
// set up the curl resource
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
"https://User:[email protected]/services/rest/connect/v1.3/queryResults
/?query=select%20ID%20from%20CO.A_Country%20where%20CO.A_Country.A_Country=%27xxx%27");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$output = curl_exec($ch);
echo($output). PHP_EOL;
curl_close($ch);
>
私は次のような結果になっています:?$出力にあることが唯一の希望IDを取得する方法
HTTP/1.1 200 OK Date: Thu, 04 Aug 2016 14:58:02 GMT Server: Apache Content-Language: en-US RNT-Time: D=58455 t=1470322682582920 RNT-Machine: 128.64 Transfer-Encoding: chunked Content-Type: application/json { "items": [ { "tableName": "CO.Affected_Country", "count": 1, "columnNames": [ "id" ], "rows": [ [ "12" ] ] } ], "links": [ { "rel": "self", "href": "https://test.help.com/services/rest/connect/v1.3/queryResults?query=select%20ID%20from%20CO.A_Country%20where%20CO.A_Country.Affected_Country=%27USA%27" }, { "rel": "canonical", "href": "https://test.help.com/services/rest/connect/v1.3/queryResults" }, { "rel": "describedby", "href": "https://test.help.com/services/rest/connect/v1.3/metadata-catalog/queryResults", "mediaType": "application/schema+json" } ] }
を?
これは私が探しているものです。よろしく – Walid