Uploading via API problem?

Im getting this error when attempting to upload a listing via API


“status”: “FAILURE”,
“data”: null,
“error”: {
“message”: “Forbidden”,
“code”: 403

It looks like api/v1/listing/mine isn’t enabled for API users. That’s supposed to show you your own listings (download a list of items you have for sale).

But you wanted to upload a listing, so the sample code you want is in src/samples/rl_listing.js, which is to post a listing.

1 Like

Okay, thank you. I’ll get that to my developer and see what he says.

If you do you want to search for your own listings, look at src/samples/search_listing.js.
For the query object, use this instead:

// owner ID can be found in the URL of your profile page
let query = {
    owner: 'us-east-1:026086c6-a51a-412e-b245-fd1dcb9b1be6'

let listings = await gfapi.listing_search(query);
listings.map(listing => {
    console.log("=== Listing " + listing.id, JSON.stringify(listing, null, 2));

That will print all your listings, the equivalent of api/v1/listing/mine. More documentation at https://gameflip.github.io/gfapi/Listing.html