Access Token and Developer Token
AnsweredHello,
I am new to box. Working only with .net sdk.
have created the app in the "Box developer". I had seen Access token and refresh token (I had seen it earlier, but I do not see it anymore). I however have noted both of them can I use them?. I see a developer token that has to be created every hour, what is the difference between developer token and access token.
I tried enumerate the files from my box account. I got the following error
"The API returned an error [InternalServerError | 1ff9eb6346e5f3c86613144bc4a46e3ac.1ff9eb6346e5f3c86613144bc4a46e3ac] internal_server_error - Authorization Failed"
Here is the .net program.
static void Main(string[] args)
{
Console.WriteLine("Enter token:");
string token = Console.ReadLine();
var auth = new OAuthSession(token,
"WnzLeadQiJ89fYilR1xyYJvmMKxONt5i0N8CFYnT0hbbVerrq9Y3DSUV2C1HPrtq",
3600,
"bearer");
var config = new BoxConfig(string.Empty, string.Empty, new Uri("http://localhost"));
var client = new BoxClient(config, auth);
Task t = MainAsync(client);
t.Wait();
}
private static async Task MainAsync(BoxClient client)
{
try
{
var coll = await client.FilesManager.GetFileTasks("0");
}
catch (Exception ex)
{
throw;
}
}
I used the developer token for the access token.
Can you please let me know where was access and refresh token which I do not see now.
Thanks,
Subhash
-
Hi ,
Thanks for reaching out. Good question.
Think of the developer token method as a way to test api calls manually without setting up either of Box's two authentication methods. This is useful if you just want to see how the API works, but once you're at the stage of wanting to build application logic, you will want to make sure you set up an auth method.
Let me point you to this guide:
https://developer.box.com/guides/authentication/select/
There are some samples in .NET there for each method. If you haven't worked with these authentication methods before with other APIs, it can be a lot to understand at once, so definitely take your time and don't worry too much if you need to test and try things out. Hope that helps!
Please sign in to leave a comment.
Comments
2 comments