GET rest/codes?externalId={externalId}&excludeExpiredCoupons={excludeExpiredCoupons}&excludeRedeemedCoupons={excludeRedeemedCoupons}

Gets existing coupon recipients identified by externalId.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
externalId

External Id.

string

Required

excludeExpiredCoupons

Do not return expired coupons.

boolean

Default value is True

excludeRedeemedCoupons

Do not return redeemed coupons.

boolean

Default value is True

Body Parameters

None.

Response Information

Resource Description

Collection of CouponRecipientExternal
NameDescriptionTypeAdditional information
Id

Id of the coupon recipient.

integer

None.

CouponId

Id of the coupon the recipient belongs to.

globally unique identifier

None.

CouponName

Name of the coupon. Note: This is an internal name.

string

None.

CouponBookId

Id of the coupon booklet this coupon code is included in, or null if it is a standalone coupon code.

globally unique identifier

None.

CouponBookName

Name of the coupon booklet this coupon code is included in, or null if it is a standalone coupon code. Note: This is an internal name.

string

None.

CouponCode

Coupon code.

string

None.

Url

URL to the coupon code (webpage), if viewed in a browser.

string

None.

Metadata

Code metadata.

CouponRecipientMetaData

None.

DynamicFields

A list of dynamic fields. The key is used in the HTML template and replaced with the corresponding value when the actual coupon is served.

Dictionary of string [key] and string [value]

None.

CouponVersion

Coupon version.

integer

None.

Response Formats

application/json, text/json

Sample:
[
  {
    "id": 1,
    "couponId": "d75f28a4-2ba5-475d-a7fb-eba8e652394d",
    "couponName": "sample string 3",
    "couponBookId": "76436ab0-2f4f-4b96-b260-9ac180d89ccc",
    "couponBookName": "sample string 4",
    "couponCode": "sample string 5",
    "url": "sample string 6",
    "metadata": {
      "timesUsed": 1,
      "usageCount": 2,
      "validFrom": "2018-09-08T03:16:27.2602944Z",
      "validTo": "2018-09-08T03:16:27.2602944Z"
    },
    "dynamicFields": {
      "sample string 1": "sample string 2",
      "sample string 3": "sample string 4"
    },
    "couponVersion": 7
  },
  {
    "id": 1,
    "couponId": "d75f28a4-2ba5-475d-a7fb-eba8e652394d",
    "couponName": "sample string 3",
    "couponBookId": "76436ab0-2f4f-4b96-b260-9ac180d89ccc",
    "couponBookName": "sample string 4",
    "couponCode": "sample string 5",
    "url": "sample string 6",
    "metadata": {
      "timesUsed": 1,
      "usageCount": 2,
      "validFrom": "2018-09-08T03:16:27.2602944Z",
      "validTo": "2018-09-08T03:16:27.2602944Z"
    },
    "dynamicFields": {
      "sample string 1": "sample string 2",
      "sample string 3": "sample string 4"
    },
    "couponVersion": 7
  }
]

application/xml, text/xml

Sample:
<ArrayOfCouponRecipientExternal xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.linkmobility.com/common/coupons">
  <CouponRecipientExternal>
    <CouponBookId>76436ab0-2f4f-4b96-b260-9ac180d89ccc</CouponBookId>
    <CouponBookName>sample string 4</CouponBookName>
    <CouponCode>sample string 5</CouponCode>
    <CouponId>d75f28a4-2ba5-475d-a7fb-eba8e652394d</CouponId>
    <CouponName>sample string 3</CouponName>
    <CouponVersion>7</CouponVersion>
    <DynamicFields xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>sample string 1</d3p1:Key>
        <d3p1:Value>sample string 2</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>sample string 3</d3p1:Key>
        <d3p1:Value>sample string 4</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </DynamicFields>
    <Id>1</Id>
    <Metadata>
      <TimesUsed>1</TimesUsed>
      <UsageCount>2</UsageCount>
      <ValidFrom>2018-09-08T03:16:27.2602944+00:00</ValidFrom>
      <ValidTo>2018-09-08T03:16:27.2602944+00:00</ValidTo>
    </Metadata>
    <Url>sample string 6</Url>
  </CouponRecipientExternal>
  <CouponRecipientExternal>
    <CouponBookId>76436ab0-2f4f-4b96-b260-9ac180d89ccc</CouponBookId>
    <CouponBookName>sample string 4</CouponBookName>
    <CouponCode>sample string 5</CouponCode>
    <CouponId>d75f28a4-2ba5-475d-a7fb-eba8e652394d</CouponId>
    <CouponName>sample string 3</CouponName>
    <CouponVersion>7</CouponVersion>
    <DynamicFields xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>sample string 1</d3p1:Key>
        <d3p1:Value>sample string 2</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>sample string 3</d3p1:Key>
        <d3p1:Value>sample string 4</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </DynamicFields>
    <Id>1</Id>
    <Metadata>
      <TimesUsed>1</TimesUsed>
      <UsageCount>2</UsageCount>
      <ValidFrom>2018-09-08T03:16:27.2602944+00:00</ValidFrom>
      <ValidTo>2018-09-08T03:16:27.2602944+00:00</ValidTo>
    </Metadata>
    <Url>sample string 6</Url>
  </CouponRecipientExternal>
</ArrayOfCouponRecipientExternal>