Comments (2)
We also using Express as Backend. I don't know what exactly is the error. Here is how we do the call, maybe it helps:
const eBay = new eBayApi({
// ....
scope: [
'https://api.ebay.com/oauth/api_scope',
'https://api.ebay.com/oauth/api_scope/sell.marketing.readonly',
'https://api.ebay.com/oauth/api_scope/sell.marketing',
'https://api.ebay.com/oauth/api_scope/sell.inventory.readonly',
'https://api.ebay.com/oauth/api_scope/sell.inventory',
'https://api.ebay.com/oauth/api_scope/sell.account.readonly',
'https://api.ebay.com/oauth/api_scope/sell.account',
'https://api.ebay.com/oauth/api_scope/sell.fulfillment.readonly',
'https://api.ebay.com/oauth/api_scope/sell.fulfillment',
'https://api.ebay.com/oauth/api_scope/sell.analytics.readonly',
'https://api.ebay.com/oauth/api_scope/sell.finances',
'https://api.ebay.com/oauth/api_scope/sell.payment.dispute',
'https://api.ebay.com/oauth/api_scope/commerce.identity.readonly'
]
});
const token = await getFromDb(); // get the token that was created in the ebay sign in process
eBay.setCredentials(token);
// Listen to refresh token event, and update the token in the DB
eBay.OAuth2.on('refreshAuthToken', (token: any) => {
storeInDb(token).then(() => console.log('token is stored'))
});
eBay.sell.fulfillment.getOrders({
limit: 5
}).then(order => {
console.log('order', JSON.stringify(order, null, 2));
}).catch(e => {
console.error(JSON.stringify(e, null, 2));
});
Check if you always use the same scope for sign in and API request.
You have to generate the first token with all scopes you need for you app.
If you add a new scopes later and use a token that was not authorized with this scope, it will not work!
I'm sure that refreshing the token will also not help. You have to obtain the token already with all required scopes!
Btw. You don't need to refresh it manually. It's done automatically. You can listen to the event and store the token (as shown in the example above)
from ebay-api.
Thank you, it completely works now for me. In the end, it was passing in the original complete token object that solved it...
let user = await User.findById({_id})
// set OAuth2 eBay credentials
eBay.auth.oAuth2.setCredentials(user.token[0])
from ebay-api.
Related Issues (20)
- use the Axios interceptor to manipulate the response
- Feature Request: Digital Signatures for APIs HOT 8
- I'm not getting itemAffiliateWebUrl from eBay.buy.browse.search HOT 2
- eBay Marketplace Account Deletion/Closure Notifications Workflow HOT 3
- I
- Inventory API > bulkMigrateListings call - Invalid value for header Accept-Language. HOT 1
- Unable to find the Account API call "getAdvertisingEligibility" HOT 2
- Can't find getAdGroups in the Marketing API calls HOT 1
- FindProducts in shopping API always returns "No Match Found" HOT 2
- createOrReplaceInventoryItem of Inventory API is not updating title, returns empty string
- Error when calling getResultFile HOT 3
- How to get rlogid from getInventoryItem call in Inventory API HOT 5
- Unable to filter using sell.fulfillment.getOrders
- GetSellerDashboard constantly returns error HOT 1
- Access token is not being refreshed by 403s on inventory item endpoint HOT 1
- Switching from axios to unjs/ofetch HOT 1
- Unable to compile ebay-api in react project HOT 1
- "could not be found or is not available in the system for the marketplace EBAY_AU" HOT 1
- listingStartDate not on type EbayOfferDetailsWithId HOT 6
- aspects in InventoryItem is now just a string HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ebay-api.