Need Help on Authentication Process
Hi ,
I am new to the Box Api calls. i am using the Box api calls in application inorder to retreive the files in Box .
For that we need to authenticate the Box inorder to get connected . For testing purpose i have used the developer token but that is expired in l hour. In our application we need to retrieve the files daily from box.
Can you please advise me how do i get the authentication process programatically in java.
I also tried with the api.authenticate(authCode) method but that works only once after that it throws an 400 error.
Thanks
-
Hi Tanzeem,
You can go through this FAQ:
https://community.box.com/t5/Developer-Forum/FAQ-Box-Platform-and-APIs/m-p/14768#U14768
refrer to the section "How do I automate the generation of OAuth tokens or run a server-side solution?"
The verdict is : you will have to use the "RefreshToken" that you obtained during the first call to obtain NEW tokens. And the new tokens will have both NEW Access and Refresh token. and again after hour you request new tokesn. Hope this helps.
thanks,
Bibek
-
Hi
If I want to implement server-side solution without user interaction, as per my understanding, I need to save Access token and Refresh token on some flat file/DB (considering server downtime) and use refresh method every time by setting those values to api connection. Is that correct?
Thanks
Sudhakar
Please sign in to leave a comment.
Comments
2 comments