added examples shortcode
This commit is contained in:
@@ -68,6 +68,31 @@ class APIgoatFetchAPI
|
||||
}
|
||||
}
|
||||
|
||||
public function fetchExamples()
|
||||
{
|
||||
$clientOptions = $this->clientOptions;
|
||||
$clientOptions['query'] = [
|
||||
"query" => [
|
||||
"select" => [
|
||||
"name", ["description", "text"], ["example_category.name", "category_name"], "json"
|
||||
],
|
||||
"join" => ["example_category"]
|
||||
]
|
||||
];
|
||||
|
||||
//$clientOptions['debug'] = true;
|
||||
$response = $this->client->get('Example', $clientOptions);
|
||||
|
||||
$body = json_decode($response->getBody()->getContents(), true);
|
||||
//$body['debug'][] = $clientOptions['query'];
|
||||
if ($response->getStatusCode() == 200) {
|
||||
return $body;
|
||||
} else {
|
||||
$body = json_decode($response->getBody(), true);
|
||||
return $body;
|
||||
}
|
||||
}
|
||||
|
||||
private function saveCredentials()
|
||||
{
|
||||
if (!empty($this->jwt_pubkey)) {
|
||||
|
||||
Reference in New Issue
Block a user