PHP Classes

return function CallAPI()

Recommend this page to a friend!

      PHP OAuth Library  >  PHP OAuth Library package blog  >  How to Implement PHP ...  >  All threads  >  return function CallAPI()  >  (Un) Subscribe thread alerts  
Subject:return function CallAPI()
Summary:http code 403
Messages:5
Author:Felipe Pimenta
Date:2014-07-15 14:24:39
Update:2014-07-17 13:39:10
 

  1. return function CallAPI()   Reply   Report abuse  
Picture of Felipe Pimenta Felipe Pimenta - 2014-07-15 14:24:39
Good day!

I'm using the file 'login_with_google.php' to use the Chrome Remote Desktop API. When I use the CallAPI () function, the value of the variable $ response returns me an http 403 error with the message "Insufficient Permission". I wonder if the returned message is because of the scope, which may be wrong, or if it is some problem with my same User.

  2. Re: return function CallAPI()   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-07-15 21:36:31 - In reply to message 1 from Felipe Pimenta
It may be the problem, I am not certain. You should use at least one of these scopes.

googleapis.com/auth/chrome/remote-d ...
googleapis.com/auth/chrome/remote-d ...

Keep in mind that if you already got a access token with these scopes, you need to get a new token to make it work. You can call ResetAccessToken function to discard the old token.

  3. Re: return function CallAPI()   Reply   Report abuse  
Picture of Felipe Pimenta Felipe Pimenta - 2014-07-16 12:18:38 - In reply to message 2 from Manuel Lemos
Manuel, gostaria de saber se a função CallAPI() é pra chamar toda a API, ou só para chamar um método especifico da API.

Em relação a Resposta acima, já utilizei estes escopos para pegar o Token de acesso, mas sempre dá uma mensagem de erro. Estou utilizando os seguintes escopos:

googleapis.com/auth/userinfo.email
googleapis.com/auth/userinfo.profil ...

  4. Re: return function CallAPI()   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-07-16 21:06:07 - In reply to message 3 from Felipe Pimenta
A função CallAPI server para qualquer função de qualquer API, pois apenas tem de informar o URL da chamada à API. A única coisa é que o token tem de ser obtido com as permissões necessárias definidas pelo parâmetro scope para chamar as APIs que precisa.

  5. Re: return function CallAPI()   Reply   Report abuse  
Picture of Felipe Pimenta Felipe Pimenta - 2014-07-17 13:39:10 - In reply to message 4 from Manuel Lemos
Muito obrigado pela ajuda!!
Agora estou conseguindo comunicar com a API, chamando os metodos dos quais preciso.