Professional Documents
Culture Documents
Exemplo de Webhooks - Cs
Exemplo de Webhooks - Cs
Exemplo de Webhooks - Cs
using System.Collections;
using System.Data;
using System.Web;
using System.IO;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace NsAssertivoPainel
{
public partial class PgnApi : System.Web.UI.Page
{
Processar();
}
else
{
Response.StatusCode = 406;
json_return = "Falha na inclusão do retorno.";
}
}
else
{
Response.StatusCode = 406;
json_return = "Conteúdo incorreto.";
}
}
catch (FormatException)
{
Response.StatusCode = 401;
json_return = "Credenciais formatadas incorretamente.";
}
}
else
{
Response.StatusCode = 406;
json_return = "Parâmetro incorreto.";
}
}
catch (Exception ex)
{
Response.StatusCode = 500;
string sMsg = ex.Message.ToString().Replace("'", "").Replace("\
r\n", "<br>");
if (ex.InnerException != null)
sMsg += ex.InnerException.Message.ToString().Replace("'",
"").Replace("\r\n", "<br>");
json_return = sMsg;
}
Response.Write(json_return);
try
{
Response.End();
}
catch (Exception) { }
}
void Processar()
{
try
{
PrvTratarWebHookProcessProvider PreDefProvider = new
PrvTratarWebHookProcessProvider(this);
PreDefProvider.AliasVariables = new Dictionary<string,
object>();
PreDefProvider.AliasVariables.Clear();
PreDefProvider.ExecutePreDefinedProcess();
}
catch (Exception) { }
}
}
}