Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kiyoh url to get json response #5

Closed
Navin-Gelot opened this issue Sep 7, 2018 · 1 comment
Closed

Kiyoh url to get json response #5

Navin-Gelot opened this issue Sep 7, 2018 · 1 comment

Comments

@Navin-Gelot
Copy link

Navin-Gelot commented Sep 7, 2018

Hello Kiyoh team,

i have my company id and basic information. Is there any way to access json response of my review ?

@JKetelaar
Copy link
Owner

Hi there, you can use the following example code:

<?php
require_once('vendor/autoload.php');

$connector = 'YOUR_CONNECTOR_CODE'; // Change with your Connector code
$company = 1234; // Change with your Company number

$kiyoh = new \JKetelaar\Kiyoh\Kiyoh($connector, $company);

/** @var \JKetelaar\Kiyoh\Models\Review[] $reviews */
$reviews = $kiyoh->getReviews();

var_dump($reviews[0]->getId());
// ..

/** @var \JKetelaar\Kiyoh\Models\Company $company */
$company = $kiyoh->getCompany();

var_dump($company->getTotalScore());
var_dump($company->getUrl());
var_dump($company->getCategory());
var_dump($company->getCategory()->getTitle());
var_dump($company->getAverageScores()->getQuestions());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants