NativeRest

Product details

Q: Pre-request script feature as in Postman (to sign requests)?

Hello, so I bought Nativerest and I'm trying to use it to build an integration to a service (https://developers.3commas.io/quick-start/signing-a-request-using-hmac-sha256). However, for this I need to generate a custom HMAC signature for each request based on my secret key.

With Postman I have the pre-request feature that can do this. However, how can I do this in NativeRest?

I can of course do this in the Mac terminal, but it's just quite a pain to work like this whenever you make requests.

0e0b0dd3f6754365b27f521786b3910bPLUSJun 26, 2025
Founder Team
uhaleks

uhaleks

Jun 26, 2025

A: Hello! πŸ‘‹
Thank you for purchasing NativeRest. ✨
Currently, NativeRest only has a sha256 hashing function with one parameter. It won't work in this case. I looked at the API on your link and understand what is required. In a few days, I will add the hmac-sha256 function with two parameters to NativeRest. I'll reply to you here additionally as soon as it appears in NativeRest. πŸ™Œ

Share
Helpful?
Log in to join the conversation
Verified Purchaser badge

Verified purchaser

Posted: Jun 26, 2025

Awesome man! Thank you and much appreciated! Really looking forward to your update!

Verified Purchaser badge

Verified purchaser

Posted: Jun 29, 2025

Hi, I'm curious if there's any updates on this?

Founder
Posted: Jun 29, 2025

Hi! Yes, I have great news!
Right now the new version of NativeRest 2.6.2 is available. I just finished the necessary release notes and wanted to write to you.
Now you need to use the new hmac.sha256 function to fill in the Signature header.
This function has 2 parameters: Data, Key.
In the first - payload, and in the second - secret.
Signature: {{hmac.sha256({{payload}},{{secret}})}}

Founder
Posted: Jun 29, 2025

This is a continuation of my answer:
In my example, 2 parameters are declared payload and secret, in which the values ​​are written:
payload = /public/api/ver1/users/change_mode?mode=paper
secret = NhqPtmdSJYdKjVHj...
In my opinion, variables are more convenient, but it is not necessary to use them.

Founder
Posted: Jun 29, 2025

See an example of using hmac.sha256 in NativeRest in this screenshot:
https://nativesoft.com/static/images/using-hmac-sha256-function.png

Verified Purchaser badge

Verified purchaser

Posted: Jul 7, 2025

Awesome, thank you! I made a GET request successfully using your new feature!
I will let you know if I have further issues.

But have a comment about the Mac app. I don't think the shortcuts are very logical.
1. I wonder why for the duplication, why do you have to add shift to every keyboard shortcut?
2. also when you tap around to select words, you use very weird keys for the Mac.

Verified Purchaser badge

Verified purchaser

Posted: Jul 7, 2025

Continued... Mac uses option/alt+arrow left/right to jump between words. You use command+shift+arrow left/right to select the whole line. And most importantly, you use shift+alt+arrow left/right to select a word. This is not how it works in Native Rest. So it feels quite unintuitive when working on a Mac. I hope this can be fixed in the Mac version. Check app on Mac to see (TextEdit, browsers etc)

Verified Purchaser badge

Verified purchaser

Posted: Jul 7, 2025

Finally I wonder if it's possible to get this work in a way where I don't have to specify the endpoint twice. Because right now I have to specify the endpoint path in the variables. And continuously update this, it could be nice if it would simply take the endpoint path from the URL bar. Then I could insert that variable in the signature generation.

Verified Purchaser badge

Verified purchaser

Posted: Jul 7, 2025

In addition, whenever I work on a new request, I have to go back and update the workspace variable to use a different payload for every request since the payload is not part of the request itself, but part of the workspace variables. So I can't really keep multiple requests open in a working state, it seems, because the payload variable I have to set each time - it is not saved with the request.

Verified Purchaser badge

Verified purchaser

Posted: Jul 7, 2025

To clarify the last part. "Because the payload variable I have to set each time - it is not saved with the request." This is because the payload variable is set as a "workspace variable" in your example so it applies to all the requests that you have created in NativeRest so it is continuously overwritten and breaks other requests. Not good. How can I avoid this so "payload" save with the requests

Verified Purchaser badge

Verified purchaser

Posted: Jul 7, 2025

And I just realized that this is actually a big issue. Because sometimes the payload is not just the path, but naturally needs to include a body as well. You have to enter lots twice. So again, it would be nice to also be able to reference this from the Body section directly. Couldn't you make it possible to variable to the Body section.

Verified Purchaser badge

Verified purchaser

Posted: Jul 7, 2025

Example:
Body: {
"account_id": 12345,
"pair": "USDT_BTC",
"position": {
"type": "buy"
}
}
I have to repeat this - how about making a variable?
payload: /public/api/ver1/smart_trade{"account_id":12345,"pair":"USDT_BTC","position":{"type":"buy"}}

Founder
Posted: Jul 7, 2025

Hi! πŸ‘‹ Thank you for these suggestions and comments. πŸ™Œ
1. I'll take another look at the standard hotkeys for working with text in macOS and try to improve this in NativeRest.
2. Please try the variable {{request.uri.path}} – it returns the path (/public/api/ver1/users/change_mode). For example:
Signature: {{hmac.sha256({{request.uri.path}}?mode=paper,{{secret}})}}

Founder
Edited: Jul 7, 2025

Would you like a new {{request.body}} variable to get the request body for use in headers?
If you prefer, you can write to me at support@nativesoft.com. The message length limit here is too small for our discussion. πŸ˜†

Verified Purchaser badge

Verified purchaser

Posted: Jul 7, 2025

Also you cannot put the cursor in a string and then shift-click before or after this to select everything in between.