O'Reilly logo

Facebook Cookbook by Jay Goldman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deleting Marketplace Listings

Problem

I need to delete a Marketplace listing.

Solution

Use the Marketplace.removeListing() method:

$result = $facebook->api_client->marketplace_removeListing('1234567');

You can optionally specify a status to make it clear why the listing is being removed. Valid statuses are SUCCESS, DEFAULT, or NOT_SUCCESS (the default is, unsurprisingly, DEFAULT):

$result = $facebook->api_client->marketplace_removeListing('1234567', 'SUCCESS');

Discussion

You can also tag a uid on the end to specify whose listings you’re deleting if they are not the current loggedinuser (this will be ignored for desktop apps). Marketplace.removeListing() will return true (1) on success, and false (0) or an error on failure.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required