using System.Collections.Generic;
using HexaEightASKClientLibrary.HexaEight;
[JsonProperty("this")] private string _this;
[JsonProperty("by")] private string _by;
[JsonProperty("the")] private string _the;
[JsonProperty("with")] private List<With> _withList;
internal string This => _this;
internal string By => _by;
internal string The => _the;
internal List<With> WithList => _withList;
[JsonProperty("thing")] private string _thing;
[JsonProperty("created")] private string _created;
[JsonProperty("content")] private Content _content;
internal string Thing => _thing;
internal string Created => _created;
internal Content Content => _content;
[JsonProperty("data")] private string _data;
internal string Data => _data;
public static void Main()
var generic_resource_login_token = "BTcLUOYpr7VfsMXFHU/H9bSOUWwPWRLarSN6RW/l1LEjOp7+L6GJe4CdwWI3O34Ji/3IJ85eIN2zP4TJOGRZZXaMCWRZ4S+tYAAJvbHfGNgxTi6qZ+JC8j7dgKIKpt1bnMwTW+xVx6ijKL5/2jiHsuN5MPa7fAFwg5+E1Wl3aQbyQ36wXvDtwslGfUbgiEqsmYrRejskZ7XH6ji8wN38JCEcCKkfK2htNUVvapVUaRUmwuSC+BpVrbgjO3vw9G2g40D3fMW06da+Fw7B/zV/VT0KwRf5suxWqNQ8FhNORcI=.9siUx94ngj5aUbEq19/6EBqUppzBarCXzLTIiqVd3/lMmdZgx8VHbv/26AM/k16hkVnXULpnor3fC/FbypG5GyoNcfmATBePIk9rvbzg8DYmLZ1JeWHOEgwTQVwXjVVSYfBYv9FWEvFjhdvmF8d4WzMZ80UrN6DQ/KwkatI+/xszGYgbRp2/QIBuokCbLZdWS6ksSMVk18ZYjZBB+I8pLUmFfGvR+rV9O4E6PTRm2hCZ0OogYLWzXhV9pUmsMES5i1Q2Mz9H4deGnrML4aRG6ZT+6Sf6dXLpiuRNo/Uba+NQJ0NljoiMPp/ZA7gQvTqFA9nsqrRgZtj+RfCn+l7p:Q19p4rpNUMuwiMpS3N1Bhg95cSJdwrTds/3KTywn9ONkjU/dvlHVhblDAwfMeWrgwabk3TFezLma70Y2nzDP+TFrsnCTKKYgAhAkqS9o8GOaslgJJqTJR+vAWiyL+CGOus0bMSraSmINZ2BqnRXlFLOekswt5eW3E9qBy6xhMyJj3yqmmfWzxpgSRd5dVfytotb5A5VDr1WjBPijuV9rMXPfuzhRhku96HkCyQG+Dj8JgPJCPETnI3LHw1VsqKCni1Q2Mz9H4deGnrML4aRG6ZT+6Sf6dXLpiuRNo/Uba+NQJ0NljoiMPp/ZA7gQvTqFA9nsqrRgZtj+RfCn+l7p";
var generic_resource_name = "32F06EE16908D7D40732761920122DDC80068DF91C3542DD9C787D49C6F214E5";
var generic_resource_login_token_password = "3fdh#hHvJeCT32FA?T3N22VAHV&2#6VW";
var myhost = new ASKClient(generic_resource_login_token, generic_resource_name, generic_resource_login_token_password);
myhost.SetRapidAPIKey("Put Your API Key Here");
var commondatasink_url = "https://dweet.io/get/dweets/for/" + generic_resource_name.ToString().Trim();
using var client = new HttpClient();
var sourceidentifiers =new Dictionary<string,string>();
var AsymmetricSharedKeys =new Dictionary<string,string>();
var dataresult = client.GetAsync(commondatasink_url).GetAwaiter().GetResult();
string dataresponse = dataresult.Content.ReadAsStringAsync().GetAwaiter().GetResult();
var incomingdata =JsonConvert.DeserializeObject<Parent>(dataresponse);
Console.WriteLine("Displaying Latest Received Data");
Console.WriteLine("-------------------------------");
for (var ctr = 0; ctr < incomingdata.WithList.Count; ctr++)
var withdata = new With();
var content = new Content();
withdata = incomingdata.WithList[ctr];
content = withdata.Content;
var kgt = content.Data.Split("|")[0];
var sinkdata = content.Data.Split("|")[1];
var sourceidentifier = sinkdata.Split(".")[0];
var encrypteddata = sinkdata.Split(".")[1];
var decrypteddata = myhost.DecryptMessageUsingHEToken(sinkdata).GetAwaiter().GetResult();
var resptemplate = new { REQUEST = "", SENDER = "", RECEIVER = "", STIME = "", RTIME = "", BODY = "" };
var datamessage = JsonConvert.DeserializeAnonymousType(decrypteddata, resptemplate);
Console.WriteLine("Sender :" + datamessage.SENDER.ToString() + " Message :" + datamessage.BODY.ToString() + " Sent At : " + withdata.Created);