Consulta o xml de inutilização da nota fiscal em questão (parâmetro {id})

public async Task<string> ConsultarXmlInutilizacaoNFCeAsync(Guid empresaId, string nfceId)
{
  try
  {
    using (var httpClient = new HttpClient())
    {
      httpClient.DefaultRequestHeaders.Clear();
      httpClient.DefaultRequestHeaders.Add("Authorization", "Basic {Sua-ApiKey-Aqui}");
      httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

      using (var request = new HttpRequestMessage(HttpMethod.Get, string.Format("https://api.enotasgw.com.br/v2/empresas/{0}/nfc-e/Inutilizacao/{1}/xml", empresaId, nfceId)))
      {
        using (var response = await httpClient.SendAsync(request))
        {
          var resultContent = await response.Content.ReadAsStringAsync();

          if (response.IsSuccessStatusCode)
          {
            return resultContent;
          }
          else
          {
            throw new Exception(((int)response.StatusCode) + " - " + response.ReasonPhrase);
          }
        }
      }
    }
  }
  catch (Exception)
  {
    throw;
  }
}
Language
Authorization
Header
Click Try It! to start a request and see the response here!