private static void bindTagsToResource(IoTDAClient client) { TagDeviceRequest req = new TagDeviceRequest { Body = new BindTagsDTO() { ResourceId = "5e25d39a3b7c24fa3638804b_nb_0403_1", ResourceType = "device", Tags = new List <TagV5DTO>() { new TagV5DTO() { TagKey = "testTagName", TagValue = "testTagValue" } } } }; try { var resp = client.TagDevice(req); Console.WriteLine(resp.HttpStatusCode); Console.WriteLine(resp); } catch (RequestTimeoutException requestTimeoutException) { Console.WriteLine(requestTimeoutException.ErrorMessage); } catch (ServiceResponseException clientRequestException) { Console.WriteLine(clientRequestException.HttpStatusCode); Console.WriteLine(clientRequestException.ErrorCode); Console.WriteLine(clientRequestException.ErrorMsg); } catch (ConnectionException connectionException) { Console.WriteLine(connectionException.ErrorMessage); } }