question

newtrendbeautysupply avatar image
0 Likes"
newtrendbeautysupply asked

Authorization Code Grant Type for cron job

My application is using cronjob. i want o create and update item using new sell API with the help of cron job. but as per the document you must use Authorization Code Grant Type to use inventory scope.

The problem is that with Authorization Code Grant Type a manual sign in is needed.
How can i get a user access token without a signin.

access tokennew sell apicron
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sagar_developersupport avatar image
0 Likes"
sagar_developersupport answered

Hi @newtrend ,

You can not a get user access token/Authorization Code Grant Type token without getting the user consent. A user need to Agree on Grant Application Access page to generate a user access token.

REF: https://developer.ebay.com/api-docs/static/oauth-consent-request.htmlYou can also get a user access token through the eBay UI. Please go through the link given below to know more the process.

REF: https://developer.ebay.com/api-docs/static/oauth-ui-tokens.html

Best Regards ,
eBay Developer Support

10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shrijhaj0 avatar image
0 Likes"
shrijhaj0 answered

Hi Team,

@newtrendbeautysupply

I also have same use case and dont know who to proceed. Can you guys please help.

As its a cron job , we dont have any UI to get consent. Is there any other way to use Inventory API?

Thanks

· 1
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

nope. the oath process is via definition a process where the user has to give explicitly his permission. you can use the trading API and the auth'n'auth token, which has a lifetime of one year (if i´m not wrong). but if you need to use the inventory API, there is no other way.

building a UI with a "login with ebay" button is not that difficult. in case u are familiar with PHP: you can try laravel which social login for example.

0 Likes 0 ·
shrijhaj0 avatar image
0 Likes"
shrijhaj0 answered

Hi @michab2003,

Thanks for response. My use case is bit different where i cannot use any UI. My application is like a schedular/poller which run daily in morning and it will read product from specific file location and will put those product on ebay using inventory API.

Is there any way we can get non-expiry consent token so that we can login once and thn use that token for our application?


Thanks

· 5
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sorry, if you need to work with the inventory api there is no other way than using oauth, and oauth - again - is via definition a user agreement process with a very short token lifetime, because of security. once you have the token, you also get the refresh token which has a much longer lifetime. anyway, there is no way to avoid the "user has to login and agree" process, because that is exactly the definition of oauth. you can hire a developer to get a simple UI.
0 Likes 0 ·
michab2003:

There are shipping website, seems can remember your loggin information. Once you log into ebay once, those shipping website can retrieve your shipping information forever without loggin. Any clude how they did that?

0 Likes 0 ·
sure: on their website you login via ebay, they store your auth+refresh token and later on they work with that. there is nothing special, that´s how oauth works.
1 Like 1 ·
Show more comments
carl_mars avatar image
0 Likes"
carl_mars answered

Thank you Mich. the reason I start this was found some calls not available in traditional API, but Resful API.

I naught be wrong.

· 1
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

with rest, you always need oauth, correct. i only wanted to note: depending on what you need it sometimes can be easier to avoid the whole oauth stuff when all calls u need can be done with the trading. most people are totally focused on rest because it´s an easier data structure, but trading still is the most stable (and working) API, ebay has, many don´t (want to) see that ;-))
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.