Post

3 followers Follow
0
Avatar

PodioForbiddenError on item delete

I try to delete an item using the API, but the API allways returns an error.
Here is part of my PHP code:
===
require_once 'podio-php-4.3.0/PodioAPI.php';

$myClientID ="---"; //removed, but working for other calls
$myClientSecret ="---"; //removed, but working for other calls

Podio::setup($myClientID, $myClientSecret);

$myAppID ="4321"; //correct appid
$myAppToken ="--"; //correct token

Podio::authenticate_with_app($myAppID, $myAppToken);

$result = PodioItem::delete('12345');

====
Returns:

Fatal error: Uncaught PodioForbiddenError: "The app with id 4321 does not have the right delete on item with id 12345" Request URL:http://api.podio.com/item/12345 Stack Trace: #0 /mnt/webw/c3/69/56917069/htdocs/knoppacloud/mmxx/podio-php-4.3.0/lib/Podio.php(358): Podio::request('DELETE', '/item/12345', Array) #1/mnt/webw/c3/69/56917069/htdocs/knoppacloud/mmxx/podio-php-4.3.0/models/PodioItem.php(143): Podio::delete('/item/12345', Array) #2 /mnt/webw/c3/69/56917069/htdocs/knoppacloud/mmxx/empty_impromptu.php(48): PodioItem::delete('12345') #3 {main} thrown in /mnt/webw/c3/69/56917069/htdocs/knoppacloud/mmxx/podio-php-4.3.0/lib/Podio.php on line 319
===
Any ideas? All id's are correct.

 

A simulair problem was answered with: You authenticate as a light user, and you need to have admin rights. But if this is true, you will never be able to use the delete of bulk_delete API calls. So that is not a solution!

 

Kees Nobel

Please sign in to leave a comment.

5 comments

0
Avatar

Hi Kees,

Please make sure you are using "item_id", not an "external_item_id" in your example. You can check it in item "Action" menu as on attached images.

If that does not help - please provide example app_id and item_id for which you get ForbiddenError.

Jakob Pulczynski 0 votes
0
Avatar

The question is very simple:

How to authenticate as admin so you can use api-calls like bulk delete?

 

Kees Nobel 0 votes
0
Avatar

You suggest password authentication .. the documentation clearly states this is insecure.

We only use Google to login, and not username/password pair, so how would we authenticate as an admin?  (or am I being a little thick here lol)

Andrew Sowden 0 votes
0
Avatar

I was using google login as well, but forced to use username/password authentication. I changed my password because I did not want my google account password in the sourcecode...

But after I made these changes, I was able to use the API. 

Kees Nobel 0 votes