Most developers are using post-man to check REST apis.
Post-man is providing a lot of functionality. Pre-script is also one of them.
We can define and update variables before send the request.
it is useable to create a signature for REST api.
https://learning.postman.com/docs/writing-scripts/pre-request-scripts/
You can check the guide. The script is based on javascript.
So, you can simply write the script.