HTTP module header value always gets wrapped in quotes when using formatDate() output

:bullseye: What is your goal?

I am creating an HMAC-SHA256 signed authentication request to call the Naver Search Ad API. I need to send the epoch millisecond timestamp value generated by formatDate() in the HTTP module header (X-Timestamp).

:thinking: What is the problem & what have you tried?

If you place a value created with formatDate(now; โ€œxโ€) into the Value field of an HTTP module header, that value is passed in the actual request enclosed in double quotes (e.g., โ€œ1788779993467โ€ instead of 1788779993467). The target API rejects this as not being a number.

Methods attempted (all reproduced the same symptoms):

  • Directly typing formatDate(now; โ€œxโ€) into the field
  • Inserting the same formula using the function picker (not direct typing)
  • Wrapping with toString(formatDate(now; โ€œxโ€))
  • Attempting to remove quotes using replace(formatDate(now; โ€œxโ€); โ€œ"โ€; โ€œโ€)
  • Creating a value in a separate Set variable module and mapping it to the HTTP header as a token
  • Directly entering the formula into the header Value field of the HTTP module (without an intermediate module)
  • Adding it alongside other fixed values โ€‹โ€‹in the same Set multiple variables module

Fixed text values โ€‹โ€‹(e.g., hardcoded API keys) are passed normally without quotes, but in formatDate()

:clipboard: Error messages or input/output bundles

{โ€œtimestampโ€:โ€œ"1788779993467"โ€,โ€œstatusโ€:403,โ€œtypeโ€:โ€œurn:naver:api:problem:invalid-timestampโ€,โ€œtitleโ€:โ€œInvalid Timestampโ€,โ€œdetailโ€:โ€œNon-numeric character in timestamp at(0)โ€}

:link: Create public scenario page

:bullseye: What is your goal?

Naver Search Ad API ํ˜ธ์ถœ์„ ์œ„ํ•ด HMAC-SHA256 ์„œ๋ช… ์ธ์ฆ ์š”์ฒญ์„ ๋งŒ๋“ค๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. formatDate()๋กœ ๋งŒ๋“  epoch millisecond timestamp ๊ฐ’์„ HTTP ๋ชจ๋“ˆ์˜ ํ—ค๋”(X-Timestamp)์— ๋‹ด์•„ ์ „์†กํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

:thinking: What is the problem & what have you tried?

formatDate(now; โ€œxโ€)๋กœ ๋งŒ๋“  ๊ฐ’์„ HTTP ๋ชจ๋“ˆ ํ—ค๋”์˜ Value์— ๋„ฃ์œผ๋ฉด, ์‹ค์ œ ์ „์†ก๋˜๋Š” ์š”์ฒญ์—๋Š” ๊ทธ ๊ฐ’์ด ํฐ๋”ฐ์˜ดํ‘œ๋กœ ๊ฐ์‹ธ์ง„ ์ฑ„ ์ „๋‹ฌ๋ฉ๋‹ˆ๋‹ค (์˜ˆ: 1788779993467 ๋Œ€์‹  "1788779993467"). ๋Œ€์ƒ API๋Š” ์ด๊ฑธ ์ˆซ์ž๊ฐ€ ์•„๋‹ˆ๋ผ๊ณ  ๊ฑฐ๋ถ€ํ•ฉ๋‹ˆ๋‹ค.

์‹œ๋„ํ•œ ๋ฐฉ๋ฒ• (๋ชจ๋‘ ๊ฐ™์€ ์ฆ์ƒ ์žฌํ˜„๋จ):

  • formatDate(now; โ€œxโ€)๋ฅผ ํ•„๋“œ์— ์ง์ ‘ ํƒ€์ดํ•‘
  • ํ•จ์ˆ˜ ํ”ผ์ปค๋กœ ๋™์ผํ•œ ์ˆ˜์‹ ์‚ฝ์ž… (์ง์ ‘ ํƒ€์ดํ•‘ ์•„๋‹˜)
  • toString(formatDate(now; โ€œxโ€))๋กœ ๊ฐ์‹ธ๊ธฐ
  • replace(formatDate(now; โ€œxโ€); โ€œ"โ€; โ€œโ€)๋กœ ๋”ฐ์˜ดํ‘œ ์ œ๊ฑฐ ์‹œ๋„
  • ๋ณ„๋„์˜ Set variable ๋ชจ๋“ˆ์—์„œ ๊ฐ’์„ ๋งŒ๋“ค๊ณ  ํ† ํฐ์œผ๋กœ HTTP ํ—ค๋”์— ๋งคํ•‘
  • HTTP ๋ชจ๋“ˆ์˜ ํ—ค๋” Value ํ•„๋“œ ์•ˆ์— ์ˆ˜์‹์„ ์ง์ ‘ ์ž…๋ ฅ (์ค‘๊ฐ„ ๋ชจ๋“ˆ ์—†์ด)
  • ๊ฐ™์€ Set multiple variables ๋ชจ๋“ˆ ์•ˆ์— ๋‹ค๋ฅธ ๊ณ ์ •๊ฐ’๋“ค๊ณผ ๋‚˜๋ž€ํžˆ ์ถ”๊ฐ€

๊ณ ์ • ํ…์ŠคํŠธ ๊ฐ’(์˜ˆ: ํ•˜๋“œ์ฝ”๋”ฉํ•œ API ํ‚ค)์€ ๋”ฐ์˜ดํ‘œ ์—†์ด ์ •์ƒ ์ „๋‹ฌ๋˜๋Š”๋ฐ, formatDate()์—์„œ

:clipboard: Error messages or input/output bundles

{โ€œtimestampโ€:โ€œ"1788779993467"โ€,โ€œstatusโ€:403,โ€œtypeโ€:โ€œurn:naver:api:problem:invalid-timestampโ€,โ€œtitleโ€:โ€œInvalid Timestampโ€,โ€œdetailโ€:โ€œNon-numeric character in timestamp at(0)โ€}

:link: Create public scenario page

Hey there,

your keys are hardcoded inside the scenario. Make sure you rotate them and consider them leaked.

Your functions are wrong with empty spaces and unneeded quotation marks inside and then the headers in the HTTP module are all wrong. Its all just free text and not the actual values coming from the previous modules. Make sure you are selecting them from the menu and not blindly copy pasting them from somewhere.

Also, toggle the map option next to headers and then add the actual headers. The array you are trying to build is also wrong.

I fixed the formulas and the mapping but it says the api key is wrong when I ran it.