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).
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()
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)โ}
Create public scenario page
What is your goal?
Naver Search Ad API ํธ์ถ์ ์ํด HMAC-SHA256 ์๋ช ์ธ์ฆ ์์ฒญ์ ๋ง๋ค๊ณ ์์ต๋๋ค. formatDate()๋ก ๋ง๋ epoch millisecond timestamp ๊ฐ์ HTTP ๋ชจ๋์ ํค๋(X-Timestamp)์ ๋ด์ ์ ์กํด์ผ ํฉ๋๋ค.
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()์์
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)โ}