Search code examples
c#-4.0box-apiboxboxapiv2box-view-api

How to get authorize and then get access token in Box API


How to get authorize and then get access token in Box API using Console or Library project in C#. I have tried authorize API but it returns HTML. I need only THE_AUTHORIZATION_CODE so that it can be passed into Token API for getting access_token.

Or can there be an enterprise access_token which is gotten through the web portal, just like developer token, but which never expires?


Solution

  • I have resolved it By using call oauth2/token API, which returns access_token and refresh_token. access_token will expire as mentioned by @Jonh in above post. But you can store refresh_token in persistence storage. When access_token expires you can get new access_token by using refresh_token by calling same token API.