@IsaacTakushi, actually that is c# and not Java and I missed the last letter in hashedobj in my reply.
I was able to fix this by using the actual request body and not a mapped object (webhookDTO). The difference was, my mapped object had more properties, which resulted in a different hash during the hash compute. See code snippet below to get the request body:
var bodyStream = new StreamReader(HttpContext.Current.Request.InputStream);
bodyStream.BaseStream.Seek(0, SeekOrigin.Begin);
var bodyText = bodyStream.ReadToEnd();
I've been able to match the hash in the header and the computed hash and everything work as expected. Thank you for your time!
I'm not sure I follow. HubSpot adds the X-HubSpot-Signature-Version header to outgoing requests automatically, per this document. You shouldn't have to add this header yourself, as requests made to the HubSpot API won't do anything with it.
I'm not familiar with Java, but one thing does jump out at me. You're setting the hash you produce to hashedobj but then in your if statement, you have:
@IsaacTakushi, actually that is c# and not Java and I missed the last letter in hashedobj in my reply.
I was able to fix this by using the actual request body and not a mapped object (webhookDTO). The difference was, my mapped object had more properties, which resulted in a different hash during the hash compute. See code snippet below to get the request body:
var bodyStream = new StreamReader(HttpContext.Current.Request.InputStream);
bodyStream.BaseStream.Seek(0, SeekOrigin.Begin);
var bodyText = bodyStream.ReadToEnd();
I've been able to match the hash in the header and the computed hash and everything work as expected. Thank you for your time!