Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stefanozanella/b016aac022842b2c25755d64f7b9f5c2 to your computer and use it in GitHub Desktop.
Save stefanozanella/b016aac022842b2c25755d64f7b9f5c2 to your computer and use it in GitHub Desktop.
@RestController
class WebhooksController {
// ...
@Autowired
private lateinit var authorizedClientService: OAuth2AuthorizedClientService
@PostMapping("/webhooks/hubspot")
fun hubspot(@RequestBody events: List<Map<String, String>>) {
events
.map { event ->
println("########################")
println(
authorizedClientService.loadAuthorizedClient("hubspot", event["portalId"])
)
println("########################")
// ...
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment