PHP Classes

Class not working

Recommend this page to a friend!

      serpStack PHP Google Search API  >  All threads  >  Class not working  >  (Un) Subscribe thread alerts  
Subject:Class not working
Summary:API Function does not exist
Messages:6
Author:andrea
Date:2019-11-02 08:47:03
 

  1. Class not working   Reply   Report abuse  
Picture of andrea andrea - 2019-11-02 08:47:03
Hello, I have tried your example, entering my API key, but this is the result:

103: This API Function does not exist.
object(stdClass)#2 (2) {
["success"]=>
bool(false)
["error"]=>
object(stdClass)#3 (3) {
["code"]=>
int(103)
["type"]=>
string(20) "invalid_api_function"
["info"]=>
string(33) "This API Function does not exist."
}
}

where did I go wrong?

Thanks
Andrea

  2. Re: Class not working   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2019-11-02 09:27:30 - In reply to message 1 from andrea
Not sure, so let's try and figure it out.

Add

//show request
echo $serp->buildRequest().'<br>';

above

//get the response
$serp->getResponse();

in the example.php file and run it again.

You should see the request on the first line, just above the error message, it should look like this...

api.serpstack.com/search?access_key ... key removed}&query=mcdonalds&safe=1

Copy and paste that here (remember to remove your api key to keep it private).

Dave

  3. Re: Class not working   Reply   Report abuse  
Picture of andrea andrea - 2019-11-02 11:30:04 - In reply to message 1 from andrea
Thank you for the reply.

Here is what I see:

api.serpstack.com/search?access_key ...
103: This API Function does not exist.

  4. Re: Class not working   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2019-11-02 13:45:06 - In reply to message 3 from andrea
Looks right to me. It has to be bug at the API. Try going to https://serpstack.com/ and log into your account. Then click on the documentation link and you should see in the dark containers a button to Run API Request. Try from there and see what you get.

In the meantime, I will reach out to the apiLayer management to run some tests.

Dave

  5. Re: Class not working   Reply   Report abuse  
Picture of andrea andrea - 2019-11-02 14:23:54 - In reply to message 4 from Dave Smith
Thank you, I don't know why, but now it seems to work...

Regards
Andrea

  6. Re: Class not working   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2019-11-02 15:51:34 - In reply to message 5 from andrea
Great, I sent one of the owners an e-mail, that may have had something to do with it.

Dave