First off it sounds like you need a post action in your router.
scope "/webhook", MyApp do
pipe_through :api
post "/svcname", MyApp.WebhookController, :hook
end
Then in your controller handle the action. The body is already decoded in params so just pattern match on the shapes that you recognise to process it.
defp hook(conn, %{"event" => "type1", "timestamp" => timestamp, "payload" => payload} = params) do
# process timestamp and payload
end
defp hook(conn, %{"event" => "type2", "timestamp" => timestamp, "payload" => payload} = params) do ....
# etc...
end
typed on my phone so code may not compile.






















