
Solved!
Go to SolutionHow to use REST API
I build ScaleIO REST Client.
I succeed login using "/api/login"parameter,and the login returns token(key) "xxxxx" .
↓
C# code "HTTP Basic authentication"
--
string authInfo = @"admin:password";
authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
request.Headers["Authorization"] = "Basic " + authInfo;
--
but,I don't know use token(key) "xxxxx".
For example,when I invoke HTTP GET request using "/api/instances/"parameter,
returns authentication erorr(401) at System.Net.WebException.
C# code
--
reqest.Headers["-Auth-Tken"] = "xxxxx"; // "xxxxx" is access_token.
--
Responses (3)
Solutions (0)

quanghoc
2 Intern
•
40 Posts
1555
0
Posted June 11th, 2015 09:00
For all sub-sequence API calls, you just need to pass the token without username in base64 encode to the request header. So something like this:
(I'm not C# expert)