public async Task PeopleSearch() { var response = await authsomeService.PostAsync <PeopleResult>("https://api.apollo.io/v1/mixed_people/search", new { api_key = apiKey, q_organization_domains = "", page = 1, //person_titles = ["sales manager", "engineer manager"] }); var test = response; }
private async Task trackEvents(string apiKey, string paramName, string paramData) { var content = new MultipartFormDataContent("----" + DateTime.Now.Ticks); var keyContent = new StringContent(apiKey, UTF8Encoding.UTF8, "text/plain"); content.Add(keyContent, "api_key"); var data = new StringContent(paramData, UTF8Encoding.UTF8, "application/json"); content.Add(data, paramName); var response = await authsomeService.PostAsync <dynamic>("/httpapi", content); }
public async Task Start() { deviceInfo = new DeviceInfo(); authsomeService = new AuthsomeService(); GPIOService = new GPIOService(); if (!deviceInfo.DoesFileExists()) { var newDevice = await authsomeService.PostAsync <Device>(baseUrl + "/api/Device", new Device() { Name = "MyIOTDevice" }); if (newDevice.httpStatusCode == System.Net.HttpStatusCode.OK) { device = newDevice.Content; // stores the device file await deviceInfo.WriteDeviceFile(device); // informs the user the device has been registered Console.WriteLine("device registered: " + device.Id); } } else { // the device has already been registered, read the information device = await deviceInfo.ReadDeviceFile(); Console.WriteLine("device file found: " + device.Id); } hubConnector = new HubConnector(); hubConnector.OnReceive += HubConnector_OnReceive; hubConnector.Connect(baseUrl, device); }