Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideLegal TermsNuGetDev CommunityOptimizely AcademySubmit a ticketLog In
Dev Guide

getAssignedRecipientId

Queries the recipient ID a coupon code is assigned to in Optimizely Campaign.

Use this method to check whether a coupon code was used by the original recipient (e.g., for non-transferable coupons).

Type: String

Parameters

NameTypeValue
sessionIdStringID of the current session
blockIdlongID of the coupon block
codeStringCoupon code to be queried

Return values

Recipient ID of the assigned code (in most cases, this is the recipient's email address)

Code structure

String getAssignedRecipientId(String sessionId, long blockId, String code)