The API port is 8086, not 8083.
https://docs.influxdata.com/influxdb/v0.13/concepts/api/

On Fri, Aug 19, 2016 at 9:06 AM, <[email protected]> wrote:

> Hello all,
>
> I could establish connection, but when it comes to query. JSON error
> happens. Since new to this, i am trying to resolve. Any help is warm
> welcomed and thanks.
>
> Regards
> Abel
>
> <?php
> require '/vendor/autoload.php';
>
>     $client = new InfluxDB\Client('153.148.25.44', '8083');
>     $database = $client->selectDB('Meters');
>     $result = $database->getQueryBuilder()
>     ->select('*')
>     ->from('GDATA')
>     ->limit(2)
>     ->getResultSet()
>     ->getPoints();
>
>     //$result = $database->query('select * from  GDATA limit  LIMIT 5;');
>     //$points = $result->getPoints();
>     //$lastQuery = $client->getLastQuery();
>
>     echo '<pre>';
>     var_dump($result);
> ?>
> Tested database connection, it is working.
>
> Fatal error:
> Uncaught exception 'InvalidArgumentException' with message 'Invalid JSON'
> in
> C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\
> InfluxDB\ResultSet.php:30
>
> Stack trace: #0 C:\xampp\htdocs\projectone\ven
> dor\influxdb\influxdb-php\src\InfluxDB\Driver\Guzzle.php(100):
> InfluxDB\ResultSet->__construct('404 page not fo...')
>
> #1 C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\
> InfluxDB\Client.php(198):
> InfluxDB\Driver\Guzzle->query()
>
> #2 C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\
> InfluxDB\Database.php(78):
> InfluxDB\Client->query('Meters', 'SELECT * FROM "...', Array)
>
> #3 C:\xampp\htdocs\projectone\vendor\influxdb\influxdb-php\src\
> InfluxDB\Query\Builder.php(261):
> InfluxDB\Database->query('SELECT * FROM "...')
>
> #4 C:\xampp\htdocs\projectone\home.php(10): InfluxDB\Query\Builder->getRes
> ultSet()
>
> #5 {main} thrown in C:\xampp\htdocs\projectone\ven
> dor\influxdb\influxdb-php\src\InfluxDB\ResultSet.php
> on line 30
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/ms
> gid/influxdb/5560013f-d681-46fc-9ca9-a669a3004f62%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sean Beckett
Director of Support and Professional Services
InfluxDB

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALGqCvNpT01j8BxK_cZSt02NKDv0PP27jn91Cp5uV1B0C-A-kA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to