09-10-2023 11:41 AM
I am working on a thick-client application that will upload photos to eBay using the UploadSiteHostedPictures API. Because of this, there is no redirect URL available. Is it possible to generate a user access token (not an application access token) by providing a username and password in an HTTP request?
Thanks!
09-10-2023 01:31 PM
The user must log into eBay at least once to authorize your application, regardless of whether the app is web-based or standalone. That method for Auth-n-Auth is described here:
https://developer.ebay.com/api-docs/static/get_auth_n_auth_tokens.html
The auth-n-auth user-token for the Trading API can be stored in a file for up to 18 months. If this application is for a single user, the token can be acquired once and then stored for later calls to UploadSiteHostedPictures on behalf of that user. When it expires, or if revoked by the seller, it would have to again be acquired.
The OAuth method is similar, except that refresh tokens will come into play and must be refreshed after two hours, but the underlying user-token is still valid for 18 months.
Or, the UploadSiteHostedPictures call could be made with an "admin" user token, since the images are not assigned to a specific seller and can be used by any seller. The "admin" user token would need to be hard-updated every 18 months as well.