Validate JSON which has a HASH value integrated?

I get a JSON coming in trough Webhook that has a HASH value that I should take out to use it to prove the JSON itself (withput the HASH value)

Here is a code the AI provides:

if (isset($json_object["hash"])) 
{
    $hash = $json_object["hash"];
    unset($json_object["hash"]);
	if( hash_equals( $hash, base64_encode(hash_hmac("sha256", json_encode($json_object), $secret, true)) ) )
	{
        return true;
    }
}
return false;

}

Any idea how I could integrate this?

Welcome to the Make community!

Please provide an example output bundle of this.

Why do you need code from AI? Can you point to documentation of the external service that is providing the hash, that describes the hash proving process?

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Output bundles

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

2 Likes