Get badge by ID

This API is used to retrieve badge details using badge ID.

👍

Note

For detailed information about our APIs and for hands-on testing, refer documentation in API overview and step-by-step guide on making your first API call in Make your first API call .

Prerequisites

  • Authentication: Basic or OAuth authentication
  • Default access group

Resource information

URI/api_gateway/v1/badges/badgeMeta/{{badgeId}}
HTTP methodGET
Pagination supportedYes
Rate limitNA
Batch supportNA

API endpoint example

https://eucrm.cc.capillarytech.com/api_gateway/v1/badges/badgeMeta/662724bb8fe258516a88fde2?includeStatistics=true

Request path parameters

ParameterData TypeDescription
badgeId*StringUnique identifier ("id") generated during the creation of the badge.

Request query parameters

ParameterData TypeDescription
limitIntegerNumber of results. For example, number 10 retrieves the first 10 rows of the query results. Default value: 10.
orderEnumOrder of the response. Supported values: ASC/DESC.
includeStatisticsBooleanSet true to retrieve earn and issue badge details.
https://eucrm.cc.capillarytech.com/api_gateway/v1/badges/badgeMeta/6543688e66a87827bb61e62a

Response parameters

ParameterData TypeDescription
idStringUnique identifier for the badge.
orgIdIntegerOrganization ID associated with the badge.
nameStringName of the badge.
descriptionStringDescription of the badge.
startOnFloat/DoubleThe timestamp for when the badge is live.
expiresOnFloat/DoubleThe timestamp for when the badge expires.
earnedBadgeExpiryObjectDetails of earned badge expiry.
badgeNumericIdInteger
expiryTypeEnumType of expiry, e.g., "RELATIVE","ABSOLUTE","NEVER"
Relative expiry is based on when the badge was issued.
Absolute expiry is based on the fixed date from the badge issue.
Never means, the badges will never expire after the issue.
relativeExpirytypeEnumType of relative expiry.
Supported values: DAYS/WEEKS/MONTHS.
Relative expiry is based on when the badge was issued.
valueIntegerThe value indicating the duration of expiry.
issuedBadgeExpiryObjectDetails of issued badge expiry
imagesArrayList of images associated with the badge.
ownershipObjectThe module for which the badge is being created.
restrictedToOwnersEnumLists owner categories that are allowed to claim the badge.
Supported values: LOYALTY/REFERRAL_CAMPAIGNS/JOURNEYS/
AUDIENCE_CAMPAIGNS/REWARDS_CATALOG/ GOODWILL_MODULE/ MILESTONES/LOYALTY_PROMOTIONS
claimsArrayList of claims associated with the badge
customer constraintsObjectLimit on how many badges can be issued to a particular customer.
durationEnumThe duration of the constraint. Supported values: DAILY, WEEKLY, MONTHLY
refreshRateIntegerThe number of cycles of the duration.
maxEarnLimitIntegerMaximum limit the badge can be earned .
startDateDateStart date of the cycle.
endDateDateEnd date of the cycle
badgeConstraintsObjectLimit on how many quantities of a reward can be given to customers
durationEnumThe duration of the constraint. Supported values: DAILY, WEEKLY, MONTHLY
refreshRateIntegerThe number of cycles of the duration.
maxEarnLimitIntegerMaximum limit the badge can be earned.
startDateDateStart date of the cycle.
endDateDateEnd date of the cycle.
benefitsObjectList of benefits associated with the badge.
benefitTypeEnumType of benefit linked to the badge.
Supported values: "COUPON", "LOYALTY_POINTS"
programIdIntegerProgram ID for loyalty points
promotionIdIntegerPromotion ID for loyalty points
allocationStrategyIdIntegerAllocation strategy ID. Points allocation allows you to award points to customers based on certain activities.
expirationStrategyIdIntegerExpiration strategy ID
defaultTillIdNullDefault till ID.
tagsArrayProvides the details of the tags that are attached to the badges during creation of the badge. Tags are used to store additional information about the badge which can help to identify or categorize the badge.
earnTypeStringThe method the brand can issue the badge.
Supported values: EARN, ISSUE EARN.
Earn: The selected customers are enrolled for the badge and upon fulfillment of the earn condition, the badge is issued.
Issue Earn: The Badges are issued directlIDy to the customer who fulfills the earn condition.
statusStringThe badge can have three statuses upon creation.
Supported values: LIVE, UPCOMING, ENDED/EXPIRED.
LIVE: The badges are in live state and can be earned.
UPCOMING: The badges which are upcoming on a further date.
EXPIRED/ENDED: The badges which have expired and cannot be earned.
createdOnFloat/DoubleTimestamp for when the badge was created.
createdByIntegerIdentifier of the user who created the badge.
lastUpdatedOnFloat/DoubleTimestamp for the last update made to the badge.
lastUpdatedByIntegerID of the user who last updated the badge.
customFieldsObjectList of custom fields.
customFieldNameStringName of the custom field.
customFieldValueStringValue of the custom field.
activeBooleanIndicates whether the badge is active or not.
errorsNullContainer for any errors.
warningsNullContainer for any warnings.
{
    "data": {
        "id": "662749408fe258516a88fe89",
        "badgeNumericId": null,
        "orgId": 100458,
        "name": "BADGE123",
        "description": "Purchase 5 pet products in 3 months and get a pet grooming voucher",
        "startOn": 1716803487,
        "expiresOn": 1726804000,
        "earnedBadgeExpiry": {
            "expiryType": "ABSOLUTE",
            "type": "WITH_BADGE_META",
            "expiresOn": null,
            "expireWithBadgeMeta": true
        },
        "issuedBadgeExpiry": null,
        "images": [],
        "ownership": {
            "restrictedToOwners": [
                "Milestones",
                "Loyalty"
            ],
            "claims": []
        },
        "customerConstraints": [
            {
                "constraintType": "CUSTOMER_BADGE_FIXED_WINDOW",
                "referenceId": "e6791ec9-e92f-34af-bdc3-be2607fdf82c",
                "durationType": "DAYS",
                "refreshRate": 3,
                "maxEarnLimit": 1,
                "cycleStatus": "ACTIVE",
                "startDate": 1716803487,
                "endDate": 1726804000,
                "currentCycle": {
                    "startDate": 1719898518.011293,
                    "endDate": 1720071318.011293
                }
            }
        ],
        "badgeConstraints": [
            {
                "constraintType": "BADGE_FIXED_WINDOW",
                "referenceId": "a1350b49-eb8e-3500-9e43-01f5493c91c1",
                "durationType": "DAYS",
                "refreshRate": 3,
                "maxEarnLimit": 2,
                "startDate": 1716803487,
                "endDate": 1726804000,
                "cycleStatus": "ACTIVE",
                "currentCycle": {
                    "startDate": 1719898518.011462,
                    "endDate": 1720071318.011462
                }
            }
        ],
        "benefits": [
            {
                "benefitType": "COUPON",
                "seriesId": 6789
            },
            {
                "benefitType": "COUPON",
                "seriesId": 13686
            },
            {
                "benefitType": "LOYALTY_POINTS",
                "programId": 626,
                "promotionId": 80332,
                "allocationStrategyId": 1489,
                "expirationStrategyId": 3843,
                "defaultTillId": null
            },
            {
                "benefitType": "COUPON",
                "seriesId": 1234
            }
        ],
        "tags": [
            {
                "name": "Type1",
                "value": "Birthday"
            },
            {
                "name": "category",
                "value": "rare"
            },
            {
                "name": "Priority",
                "value": "1"
            }
        ],
        "badgeGroupId": null,
        "badgeRank": 1,
        "earnType": "EARN",
        "issuedCount": 0,
        "earnedCount": 0,
        "status": "LIVE",
        "createdOn": 1713850688.811,
        "createdBy": 75086856,
        "lastUpdatedOn": 1713850688.811,
        "lastUpdatedBy": 75086856,
        "customFields": {},
        "active": false
    },
    "errors": null,
    "warnings": null
}
{
    "data": {
        "id": "662724bb8fe258516a88fde2",
        "badgeNumericId": null,
        "orgId": 100458,
        "name": "OGBadge2",
        "description": "Moving window",
        "startOn": 1707523237.192,
        "expiresOn": 1715299237.192,
        "earnedBadgeExpiry": {
            "expiryType": "RELATIVE",
            "relativeExpirytype": "DAYS",
            "value": 2
        },
        "issuedBadgeExpiry": {
            "expiryType": "RELATIVE",
            "relativeExpirytype": "DAYS",
            "value": 2
        },
        "images": [
            {
                "name": "string",
                "fileSvcHandle": "string",
                "url": "string",
                "tag": "UN_EARNED"
            }
        ],
        "ownership": {
            "restrictedToOwners": [
                "Loyalty"
            ],
            "claims": []
        },
        "customerConstraints": [
            {
                "constraintType": "CUSTOMER_BADGE_FIXED_VALUE",
                "maxEarnLimit": 100
            }
        ],
        "badgeConstraints": [
            {
                "constraintType": "BADGE_FIXED_VALUE",
                "maxEarnLimit": 1000
            }
        ],
        "benefits": [],
        "tags": [
            {
                "name": "string",
                "value": "string"
            }
        ],
        "badgeGroupId": null,
        "badgeRank": null,
        "earnType": "EARN",
        "issuedCount": 0,
        "earnedCount": 0,
        "status": "EXPIRED",
        "createdOn": 1713841339.861,
        "createdBy": 75086856,
        "lastUpdatedOn": 1713841339.861,
        "lastUpdatedBy": 75086856,
        "customFields": {},
        "active": true
    },
    "errors": null,
    "warnings": null
}               "programId": 626,
                "promotionId": 80332,
                "allocationStrategyId": 1489,
                "expirationStrategyId": 3843,
                "defaultTillId": null
            },
            {
                "benefitType": "COUPON",
                "seriesId": 1234
            }
        ],
        "tags": [
            {
                "name": "Type1",
                "value": "Birthday"
            },
            {
                "name": "category",
                "value": "rare"
            },
            {
                "name": "Priority",
                "value": "1"
            }
        ],
        "badgeGroupId": null,
        "badgeRank": 1,
        "earnType": "EARN",
        "issuedCount": 0,
        "earnedCount": 0,
        "status": "LIVE",
        "createdOn": 1713850688.811,
        "createdBy": 75086856,
        "lastUpdatedOn": 1713850688.811,
        "lastUpdatedBy": 75086856,
        "customFields": {},
        "active": false
    },
    "errors": null,
    "warnings": null
}
{
    "data": {
        "id": "662724bb8fe258516a88fde2",
        "badgeNumericId": null,
        "orgId": 100458,
        "name": "OGBadge2",
        "description": "Moving window",
        "startOn": 1707523237.192000000,
        "expiresOn": 1715299237.192000000,
        "earnedBadgeExpiry": {
            "expiryType": "RELATIVE",
            "relativeExpirytype": "DAYS",
            "value": 2
        },
        "issuedBadgeExpiry": {
            "expiryType": "RELATIVE",
            "relativeExpirytype": "DAYS",
            "value": 2
        },
        "images": [
            {
                "name": "string",
                "fileSvcHandle": "string",
                "url": "string",
                "tag": "UN_EARNED"
            }
        ],
        "ownership": {
            "restrictedToOwners": [
                "Loyalty"
            ],
            "claims": []
        },
        "customerConstraints": [
            {
                "constraintType": "CUSTOMER_BADGE_FIXED_VALUE",
                "maxEarnLimit": 100
            }
        ],
        "badgeConstraints": [
            {
                "constraintType": "BADGE_FIXED_VALUE",
                "maxEarnLimit": 1000
            }
        ],
        "benefits": [],
        "tags": [
            {
                "name": "string",
                "value": "string"
            }
        ],
        "badgeGroupId": null,
        "badgeRank": null,
        "earnType": "EARN",
        "status": "EXPIRED",
        "createdOn": 1713841339.861000000,
        "createdBy": 75086856,
        "lastUpdatedOn": 1713841339.861000000,
        "lastUpdatedBy": 75086856,
        "customFields": {},
        "active": true
    },
    "errors": null,
    "warnings": null
}
{
    "data": {
        "id": "662749408fe258516a88fe89",
        "badgeNumericId": null,
        "orgId": 100458,
        "name": "BADGE123",
        "description": "Purchase 5 pet products in 3 months and get a pet grooming voucher",
        "startOn": 1716803487,
        "expiresOn": 1726804000,
        "earnedBadgeExpiry": {
            "expiryType": "ABSOLUTE",
            "type": "WITH_BADGE_META",
            "expiresOn": null,
            "expireWithBadgeMeta": true
        },
        "issuedBadgeExpiry": null,
        "images": [],
        "ownership": {
            "restrictedToOwners": [
                "Milestones",
                "Loyalty"
            ],
            "claims": []
        },
        "customerConstraints": [
            {
                "constraintType": "CUSTOMER_BADGE_FIXED_WINDOW",
                "referenceId": "e6791ec9-e92f-34af-bdc3-be2607fdf82c",
                "durationType": "DAYS",
                "refreshRate": 3,
                "maxEarnLimit": 1,
                "cycleStatus": "ACTIVE",
                "startDate": 1716803487,
                "endDate": 1726804000,
                "currentCycle": {
                    "startDate": 1719898518.011293,
                    "endDate": 1720071318.011293
                }
            }
        ],
        "badgeConstraints": [
            {
                "constraintType": "BADGE_FIXED_WINDOW",
                "referenceId": "a1350b49-eb8e-3500-9e43-01f5493c91c1",
                "durationType": "DAYS",
                "refreshRate": 3,
                "maxEarnLimit": 2,
                "startDate": 1716803487,
                "endDate": 1726804000,
                "cycleStatus": "ACTIVE",
                "currentCycle": {
                    "startDate": 1719898518.011462,
                    "endDate": 1720071318.011462
                }
            }
        ],
        "benefits": [
            {
                "benefitType": "COUPON",
                "seriesId": 6789
            },
            {
                "benefitType": "COUPON",
                "seriesId": 13686
            },
            {
                "benefitType": "LOYALTY_POINTS",
                "programId": 626,
                "promotionId": 80332,
                "allocationStrategyId": 1489,
                "expirationStrategyId": 3843,
                "defaultTillId": null
            },
            {
                "benefitType": "COUPON",
                "seriesId": 1234
            }
        ],
        "tags": [
            {
                "name": "Type1",
                "value": "Birthday"
            },
            {
                "name": "category",
                "value": "rare"
            },
            {
                "name": "Priority",
                "value": "1"
            }
        ],
        "badgeGroupId": null,
        "badgeRank": 1,
        "earnType": "EARN",
        "issuedCount": 0,
        "earnedCount": 0,
        "status": "LIVE",
        "createdOn": 1713850688.811,
        "createdBy": 75086856,
        "lastUpdatedOn": 1713850688.811,
        "lastUpdatedBy": 75086856,
        "customFields": {},
        "active": false
    },
    "errors": null,
    "warnings": null
}

API-specific error codes

Error codeDescription
404Passed badge is not found
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!