SDK Php provided is not working properly

Solved!
Posted in General by Mark Alan Tue Nov 03 2015 09:08:01 GMT+0000 (UTC)·7·Viewed 951 times

I download sdk and installed using composer I tried to run the the code and also included the api key as well but I am getting an unexpected error caused here is the error Warning: require_once(C:\wamp\www\aylien\vendor\aylien\textapi\testsbootstrap.php): failed to open stream: No such file or directory in C:\wamp\www\aylien\vendor\aylien\textapi\tests\AllTest.php on line 2 Fatal error: require_once(): Failed opening required 'C:\wamp\www\aylien\vendor\aylien\textapi\testsbootstrap.php' (include_path='.;C:\php\pear') in C:\wamp\www\aylien\vendor\aylien\textapi\tests\AllTest.php on line 2 Please let me know so I can get reid of this error as on line 2 of AllTest.php the file which i placed is require_once __DIR__ . 'bootstrap.php'; but i do not know why I am getting back of this error or is there any way I would be able to locate where and how to integrate the api excluding the install version is there any extracket version of yout api for php Thank yOu Regards Mark Alan
Amir M. Saeid
Nov 3, 2015

Hi Mark,

Can you please share the code snippet that causing these errors? Does something simple like this throw errors as well?

require __DIR__ . "/vendor/autoload.php";
$textapi = new AYLIEN\TextAPI("YOUR_APP_ID", "YOUR_APP_KEY");
Mark Alan
Nov 3, 2015

Yes I was doing wrong before I tried to modify my code but now I am getting the response as null

here is my modified code

<?php

require DIR . "/vendor/autoload.php";

$textapi = new AYLIEN\TextAPI("###", "###");

$text = 'http://mashable.com/2015/10/28/google-play-games-recording/#MkEUjgspYgq6';

$sentiment = $textapi->Sentiment(array("text" => $text));
$language = $textapi->Language(array("text" => $text));

$sentiment = $textapi->Sentiment(array(
    'text' => 'John is a very good football player!'
));

$url = 'http://techcrunch.com/2015/04/06/john-oliver-just-changed-the-surveillance-reform-debate';
$extract = $textapi->Extract(array('url' => $url, 'best_image' => 'true'));
var_dump($extract);

?>

Amir M. Saeid
Nov 3, 2015

It's most likely that it's an SSL certificate issue. Can you pass a third boolean parameter to AYLIEN\TextAPI with falue of false? That'd make calls via HTTP instead of HTTPS.

So:

$textapi = new AYLIEN\TextAPI("ID", "KEY", false);

instead of:

$textapi = new AYLIEN\TextAPI("ID", "KEY",);

Mark Alan
Nov 3, 2015

okay thank you now I got the value returned back so for the result I will clean up using the array method like will separate the data using array method right once again thank you very much

and secondly by mistake I have placed api and key in my article how can I remove it

Amir M. Saeid
Nov 3, 2015

I'm unable to find a way to edit your message and redact the secrets. I've contacted ReadMe.io support, but I suggest creating a new Application key and removing the old one via https://developer.aylien.com/.

Mark Alan
Nov 3, 2015

okay thank you


Amir M. Saeid marked this as solved
Markdown is allowed