Trying to refresh access token .NET SDK
AnsweredI created a developer token through the dashboard which works fine with regular http calls. I'm trying to use the .ET SDK instead of making a bunch of http calls now, but when i try touse the BoxFoldersManager to retrieve folder tiems, I get an "oject is not set to an instance of an object error. NotE: I do't hve a refresh token at this point. I'm trying to using the developer token I created in the dashboard.
public static BoxCollection GetFolderItems(IConfiguration config,string id) { BoxService _boxService = new BoxService(new HttpRequestHandler()); BoxJsonConverter converter = new BoxJsonConverter(); AuthRepository repository = new AuthRepository(GetBoxConfig(config), _boxService, converter); //var session = repository.RefreshAccessTokenAsync(config["access_token"]).Result; BoxFoldersManager manager = new BoxFoldersManager(GetBoxConfig(config), _boxService, converter, repository); return manager.GetFolderItemsAsync(id, 100).Result; }
I do see that the session inside the authrepository is nul so maybe that's the issue? Again I'm able to do this through regular htprequests using the endpoints in the documentation but I'd lke to use the .NET SDK.
Thanks.
-
Hey ,
Thanks for the message! Please try posting an issue thread over to the .NET SDK's issues page:
https://github.com/box/box-windows-sdk-v2/issues
While this board is excellent for general help, for sdk-specific issues you may have better success over at the individual SDK's github page.
Good luck!
Thanks,
Jason
Please sign in to leave a comment.
Comments
1 comment