// Faz a requisição de manifestação para API public static string manifestacao(string CNPJInteressado, string tpEvento, string nsu, string xJust = "", string chave = "") { ManifestacaoJSON parametros = new ManifestacaoJSON() { CNPJInteressado = CNPJInteressado, chave = (string.IsNullOrEmpty(nsu) ? chave : null), nsu = (string.IsNullOrEmpty(chave) ? nsu : null), manifestacao = new Manifestacao() { tpEvento = tpEvento, xJust = (tpEvento.Equals("210240") ? xJust : null) } }; string json = JsonConvert.SerializeObject(parametros, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); string url = "https://ddfe.ns.eti.br/events/manif"; gravaLinhaLog("[MANIFESTACAO_DADOS]"); gravaLinhaLog(json); string resposta = enviaConteudoParaAPI(json, url); gravaLinhaLog("[MANIFESTACAO_RESPOSTA]"); gravaLinhaLog(json); tratamentoManifestacao(resposta); return(resposta); }
// Faz a requisição de manifestação para API public static string manifestacao(string CNPJInteressado, string tpEvento, string nsu, string xJust = "", string chave = "") { ManifestacaoJSON parametros = new ManifestacaoJSON(); parametros.CNPJInteressado = CNPJInteressado; if (string.IsNullOrEmpty(nsu)) { parametros.chave = chave; } else { parametros.nsu = nsu; } parametros.manifestacao.tpEvento = tpEvento; if (tpEvento.Equals("210240")) { parametros.manifestacao.xJust = xJust; } string json = JsonConvert.SerializeObject(parametros, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); string url = "https://ddfe.ns.eti.br/events/manif"; gravaLinhaLog("[MANIFESTACAO_DADOS]"); gravaLinhaLog(json); string resposta = enviaConteudoParaAPI(json, url); gravaLinhaLog("[MANIFESTACAO_RESPOSTA]"); gravaLinhaLog(json); tratamentoManifestacao(resposta); return(resposta); }