Dynamic Values & Custom Functions That Save Your Time

If you’re testing APIs daily, you know the pain: copying IDs across requests, manually generating timestamps, writing throwaway scripts just to get through a checkout flow.
That’s exactly where EchoAPI’s dynamic values + custom functions shine. They let you skip repetitive work and focus on business logic, whether you’re debugging a fintech API or stress-testing your e-commerce stack.
Here’s how it works in real-world setups 👇
1. Dynamic Values: Stop Copy-Pasting, Start Automating
Dynamic values are auto-generated or real-time values (timestamps, random strings, or variables pulled from a previous response). They solve two annoying problems:
Params that always change (like
timestamp
,nonce
).Chained APIs where one request depends on the output of the last.
Example: E-commerce Checkout Flow
Imagine you’re debugging: Create Order → Make Payment
Create Order API gives you a fresh
orderId
each time. Instead of copying it by hand:Add a mock data function
Insert → send → get random test output
Extract
orderId
into your environment vars — no copy/paste
Payment API then needs:
That same
orderId
A
timestamp
(to dodge expired requests)A
nonce
(to block replay attacks)
Why It’s a Game Changer
Zero typos: Stop breaking requests because of one bad copy.
Faster debugging: A flow that used to take 5 mins → <1 min.
Global ready: Timezones handled automatically (UTC, JST, PST, WIB, etc).
2. Built-In Dynamic Values: Ready to Use
No setup, no scripts. EchoAPI ships with pre-baked dynamic values you can drop right into your requests.
Time Values (Most Used)
Great for APIs that validate timestamps, expire tokens, or just need “current time” in the right format.
👉 No timezone math. Ever.
Random Values (Perfect for Testing)
Need throwaway test data? Generate it on the fly:
Environment + Constants
Grab env info (project ID, environment, IP, EchoAPI version) or drop in constants (null
, {}
, []
, ""
) to cleanly test API behavior.
3. Custom Functions: When You Need Business Logic
Sometimes built-in tools aren’t enough. You need to encrypt, reformat, or apply custom validation. That’s where Custom Functions come in — write a quick script, run it inline, and reuse it across requests.
Example: Fintech Parameter Encryption
Say your Bind Card API requires:
Encrypting
phone
with MD5.Prefixing the result with
IDN_FIN_
.
Instead of juggling external tools, just drop in a JS function inside EchoAPI.
No need for a local crypto setup — test, debug, and ship all in one place.
Why It Matters
Custom business rules: Prefixes, non-standard algos, whatever your API demands.
Fewer dependencies: No extra tools or environments.
Region-ready: Easy to adapt for US, JP, ID, etc.
4. Built-In Functions: The Everyday Toolkit
EchoAPI also gives you system functions so you don’t even have to write code for the basics.
String ops:
strToUpper
,strTrim
,strReplace
Data conversion:
toNumber
,parseJson
,formatDate
Crypto/encoding:
md5
,sha256
,base64Encode
Math/logic:
mathAdd
,ifElse
,isEmpty
System utils:
getEnv
,setEnv
,uuid
,timestamp
Example: Generate a signed param:
const timestamp = new Date().getTime();
return `${text}-${timestamp}`;
Why This Matters
With EchoAPI, you can skip the boring stuff, reduce human error, and move faster. Whether you’re hacking on a side project or scaling across regions, dynamic values and custom functions keep you shipping — not babysitting params.
Subscribe to my newsletter
Read articles from Lazyasscoder directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
