I’m trying to get a WebAPI block working for Hashify.net. This block should hash a joined Private API key from our MAM and the rest of the query that’ll be sent to this MAM in a second Web API block.
{“Digest”:“46ed328f8db206885b05cc0-… and so on”,“DigestEnc”:“hex”,“Type”:“SHA256”,“Key”:“”}%
However, when I run the same [longstringoftext] through a WebAPI GET block in thunkable, I get a completely different hash reply.
My curl command includes the --location and -g parameters. -g has to do with treating text a certain way, so I’m suspecting the issue might be that the Thunkable block isn’t passing that parameter. Where in the WebAPI block should I supply this -g parameter?
From their docs, it looks like there is a way to change the language to Javascript - Fetch. I would recommend using this language with our WebAPI blocks.
@brianl Thanks for the tip, that sounds very interesting!
Can you elaborate on what you mean by using Javascript Fetch with the WebAPI blocks? I can’t find anything in the Thunkable docs about using actual code in WebAPI blocks, so I’m unsure on how to follow up on this.
Happy to report that I’ve managed to make Hashify work with the WebAPI blocks!
Turns out, the trick was to use https://hashify.net/hash/sha256/hex as the URL and then supply the string to be hashed as a Query Parameter. This parameter should have the name ‘value’ and the value being whatever string of text you need to hash.
Here’s what the block looks like for this test. You can see the results from the Hashify block is assigned to a variable, which is then used again as the ‘sign’ parameter of another WebAPI block. That WebAPI block then uses this hash to sign the API command to our Resourcespace MAM.
So far I’ve managed to succesfully change a value of one of our resources. Next challenge will be to upload media from the Thunkable app to Resourcespace