Salesforce-Marketing-Cloud-Engagement-Developer Practice Test

Salesforce Spring 25 Release
196 Questions

A developer wants to create a JavaScript Web Token using a key from Key Management. What function should the developer use?

A. ContentBlockByKey()

B. GetJWTByKeyName()

C. RegExMatch()

D. GeUWT()

D.   GeUWT()

Explanation:

✅ D. GetJWT()
The GetJWT() function is the correct method to use when creating a JavaScript Web Token (JWT) in Marketing Cloud. This function generates a JWT using a key stored in Key Management, which can then be used for secure communication with other services or platforms. It’s often used in scenarios involving tokenized sending or secure personalization. The function ensures the key is pulled securely from Key Management and encoded properly into a signed JWT string.

❌ A. ContentBlockByKey()
This AMPscript or SSJS function is used to retrieve content blocks by their unique key. It has nothing to do with authentication, encryption, or JWT creation. Developers use this to include modular or reusable content in emails, CloudPages, etc., not for token handling. So, while valid in other contexts, it's irrelevant for creating JWTs.

❌ B. GetJWTByKeyName()
This function does not exist in Marketing Cloud’s AMPscript or SSJS libraries. It may sound logical, but there’s no officially supported function named GetJWTByKeyName(). JWTs are created using GetJWT() and reference keys managed through the Key Management feature.

❌ C. RegExMatch()
This is a function used for regular expression matching, useful when validating strings (like checking email format, ZIP code, etc.) in AMPscript or SSJS. It’s unrelated to encryption, key management, or JWTs. Using this function for creating a token would be completely incorrect and lead to functional errors in the code.

Salesforce-Marketing-Cloud-Engagement-Developer Practice-Test - Home Previous
Page 14 out of 196 Pages