Post

2 followers Follow
0
Avatar

"Authentication as an app is not allowed for this method" problem

Hi,

I am trying to get data of someone else's app using his app id and token but its giving me "Authentication as an app is not allowed for this method" .

 

Thanks

talal m. Answered

Please sign in to leave a comment.

9 comments

0
Avatar

Hi Talal,

Not all API operations are allowed when using App Authentication. Each one will have a little note that says "App Authentication" in the top right if app auth is allowed. See for example Get Item where app auth is allowed: https://developers.podio.com/doc/items/get-item-22360

If it doesn't have that note, app auth is not allowed for that operation.

All the best,

Andreas 

Andreas Haugstrup Pedersen 0 votes
0
Avatar

I have used item and now its giving me message like "The app with id xxxxxx does not have the right view on item with id x "

talal m. 0 votes
0
Avatar

Sounds like you are trying to view an item from another app than the one you are logged in as.

Christian Holm 0 votes
0
Avatar

I am not logged in, but I am using my CLIENT_ID and CLIENT_SECRET", and other's app id and app token.

talal m. 0 votes
0
Avatar

...and you are using the app_id and app_token from a different app than the item belongs to. App auth only allows you to act on the app it's connected to. :)

Andreas Haugstrup Pedersen 0 votes
0
Avatar

CLIENT_ID, CLIENT_SECRET are of my application but I am trying to access someone else's application by providing the app_id and app

I am doing this

Podio::setup(CLIENT_ID, CLIENT_SECRET);

            // Use Podio::is_authenticated() to check is there's already an active session.

            // If there is you can make API calls right away.

            if (!Podio::is_authenticated()) {

                   $app_id = 'xxx';

                   $app_token = 'xxxx';

                    Podio::authenticate('app', array('app_id' => $app_id, 'app_token' => $app_token));

 

 

$api = Podio::instance(CLIENT_ID, CLIENT_SECRET);

 try {

                   $result = $api->item->get(1);

        

                     $this->view->result = $result;

                     print_r ($result);    

                }

            catch (PodioError $e) {

                  echo $e->body['error_description'];

            }

 

talal m. 0 votes
0
Avatar

You are trying to get the item that has an ID of 1 and you do not have access to that item. Use an item id of an item in the app you authenticate as.

Additionally you seem to have cobbled some code together from different sources. Part of it is using the new PHP client syntax, part is using the old. Make sure to grab the latest version, there are examples in the examples folder: https://github.com/podio/podio-php

Andreas Haugstrup Pedersen 0 votes
0
Avatar

fetch the id via
$item_collection = PodioItem::filter( YOUR_APP_ID );
so that you are sure you are fetching the item id of that app you are currently dealing with

Darwin Biler 0 votes