# Hashify API returns different hash | -g option?

**URL:** <https://community.thunkable.com/t/hashify-api-returns-different-hash-g-option/3117937>\
**Category:** Web API's\
**Tags:** solved\
**Created:** [July 29, 2024, 3:24pm UTC](https://community.thunkable.com/t/hashify-api-returns-different-hash-g-option/3117937 "2024-07-29T15:24:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Machinimush](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Machinimush](https://community.thunkable.com/u/Machinimush)\
**Post date:** [July 29, 2024, 3:24pm UTC](https://community.thunkable.com/t/hashify-api-returns-different-hash-g-option/3117937/1 "2024-07-29T15:24:07Z")

</div>

I’m trying to get a WebAPI block working for [Hashify.net](http://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.

I run the following curl command:

> curl --location -g ‘[https://api.hashify.net/hash/sha256/hex?value=[longstringoftext]](https://api.hashify.net/hash/sha256/hex?value=%5Blongstringoftext%5D)’

Which gives the following reply:

> {“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?

---

<div class="post-metadata">

**Author:** ![brianl](https://avatars.discourse-cdn.com/v4/letter/b/f14d63/32.png) [@brianl](https://community.thunkable.com/u/brianl)\
**Post date:** [July 29, 2024, 6:51pm UTC](https://community.thunkable.com/t/hashify-api-returns-different-hash-g-option/3117937/2 "2024-07-29T18:51:42Z")

</div>

From their [docs](https://documenter.getpostman.com/view/3362843/RWMCt9WU), it looks like there is a way to change the language to Javascript - Fetch. I would recommend using this language with our WebAPI blocks.

---

<div class="post-metadata">

**Author:** ![Machinimush](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Machinimush](https://community.thunkable.com/u/Machinimush)\
**Post date:** [July 30, 2024, 9:22am UTC](https://community.thunkable.com/t/hashify-api-returns-different-hash-g-option/3117937/3 "2024-07-30T09:22:42Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![brianl](https://avatars.discourse-cdn.com/v4/letter/b/f14d63/32.png) [@brianl](https://community.thunkable.com/u/brianl)\
**Post date:** [July 30, 2024, 3:54pm UTC](https://community.thunkable.com/t/hashify-api-returns-different-hash-g-option/3117937/4 "2024-07-30T15:54:20Z")

</div>

With our Web API blocks, you will have to take the code and translate which parts will go into which area of the Web API blocks.

For example where its says “fetch(‘[api.hashify.net/hash/md4/hex?value=helloWorld](http://api.hashify.net/hash/md4/hex?value=helloWorld)’, requestOptions)”, the URL would would go into the URL section of the Web API section.

---

<div class="post-metadata">

**Author:** ![Machinimush](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Machinimush](https://community.thunkable.com/u/Machinimush)\
**Post date:** [August 1, 2024, 5:07pm UTC](https://community.thunkable.com/t/hashify-api-returns-different-hash-g-option/3117937/5 "2024-08-01T17:07:38Z")

</div>

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](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.

 ![Thunkable_Hashify_example](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/4/7408e32c326434e08aaa1477cafc6dbc52387685.png)

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 🙂
