PLum Posted June 17, 2019 Share Posted June 17, 2019 I am trying to use the backpack api to post a trade the documentation is not helping me much. The code bellow is not posting my trade here is the api docs for refference https://backpack.tf/api/docs/create_listings const fetch = require('node-fetch'); fetch('https://backpack.tf/api/classifieds/list/v1', { method: "post", headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify({ token: 'MY_TOKEN_HERE', listings: [{ intent: 1, id: 7140702751, item: { quality: '', item_name: '', craftable: '', priceindex: '', }, offers: 0, buyout: 0, promoted:'', details: 'Please buy', currencies: {"metal": 5}, }], }) }) .then( (response) => { console.log(response.); }).catch((error)=>{ console.log(error); }); Link to comment Share on other sites More sharing options...
Zeus_Junior Posted June 17, 2019 Share Posted June 17, 2019 Try formatting your code But yea you dont have to add an `item` if the intent is 1, as explained in the docs: intent - 0 (Buy) or 1 (Sell). Required. id - Used if the intent is 1 (Sell); current id of the item to list. item - Used if the intent is 0 (Buy); item specifier. Link to comment Share on other sites More sharing options...
Walter_ Posted June 18, 2019 Share Posted June 18, 2019 18 hours ago, Zeus_Junior said: Try formatting your code But yea you dont have to add an `item` if the intent is 1, as explained in the docs: intent - 0 (Buy) or 1 (Sell). Required. id - Used if the intent is 1 (Sell); current id of the item to list. item - Used if the intent is 0 (Buy); item specifier. I have a question, will the original_id also work when listing items? I find those id's more safe to work with. Link to comment Share on other sites More sharing options...
Zeus_Junior Posted June 18, 2019 Share Posted June 18, 2019 4 hours ago, 30900_1497986031 said: I have a question, will the original_id also work when listing items? I find those id's more safe to work with. No, need the assetid. Because that is the current id in that specific user's inventory Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.