C# Sample Cloud API



I’m trying to develop an app to get the attachments for the beacons using the cloud API

I did this but the answer is not working.

var authValue = new AuthenticationHeaderValue("APP_NAME", "TOKEN");

HttpClient client = new HttpClient()
   DefaultRequestHeaders = { Authorization = authValue }

client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var responseMsg = client.GetAsync("https://cloud.estimote.com/v3/attachments").Result;

var authValue = new AuthenticationHeaderValue("APP_NAME", "TOKEN");

AFAIK, that’s not how this is supposed to be used (;

I found this example that looks more like it:

var byteArray = Encoding.ASCII.GetBytes("username:password1234");
client.DefaultRequestHeaders.Authorization = 
    new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));

Just replace username with your app ID, and password1234 with your app token.