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 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.
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
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.
tagsArrayList of tags associated with 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": "65d33b49b267bc59ab775675",
        "orgId": 4000106,
        "name": "69e79599-9b35-42a1-82bd-bf2401b3c912",
        "description": "testing-fixed-window-7-2",
        "startOn": 1707523237.192,
        "expiresOn": 1710028837.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": [
                {
                    "ownerType": "Loyalty",
                    "referenceId": "string",
                    "isActive": true
                }
            ]
        },
        "customerConstraints": [
            {
                "constraintType": "CUSTOMER_BADGE_FIXED_WINDOW",
                "durationType": "DAYS",
                "refreshRate": 3,
                "maxEarnLimit": 2,
                "startDate": 1707523237.192,
                "endDate": 1710201637.192,
                "currentCycle": {
                    "startDate": 1708599918.016172,
                    "endDate": 1708772718.016172
                }
            }
        ],
        "badgeConstraints": [
            {
                "constraintType": "BADGE_FIXED_WINDOW",
                "durationType": "DAYS",
                "refreshRate": 3,
                "maxEarnLimit": 3,
                "startDate": 1707523237.192,
                "endDate": 1710201637.192,
                "currentCycle": {
                    "startDate": 1708599918.017075,
                    "endDate": 1708772718.017075
                }
            }
        ],
        "benefits": [],
        "tags": [
            {
                "name": "string",
                "value": "string"
            }
        ],
        "badgeGroupId": null,
        "badgeRank": null,
        "earnType": "EARN",
        "issuedCount": 0,
        "earnedCount": 3,
        "status": "LIVE",
        "createdOn": 1708342089.139,
        "createdBy": 123,
        "lastUpdatedOn": 1708342094.268,
        "lastUpdatedBy": 123,
        "customFields": {
            "1": "1",
            "198": "1",
            "006b61882024-02-01 19:30:24.697800": "defaultValue",
            "9f9c337c2024-01-30 11:30:23.144958": "defaultValue",
            "nameW": "2001-01-01T10:09:09Z"
        },
        "active": true
    },
    "errors": null,
    "warnings": null
}
{
    "data": {
        "id": "662724bb8fe258516a88fde2",
        "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",
        "issuedCount": 0,
        "earnedCount": 0,
        "status": "LIVE",
        "createdOn": 1713841339.861000000,
        "createdBy": 75086856,
        "lastUpdatedOn": 1713841339.861000000,
        "lastUpdatedBy": 75086856,
        "customFields": {},
        "active": true
    },
    "errors": null,
    "warnings": null
}
{
    "data": {
        "id": "662724bb8fe258516a88fde2",
        "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": "LIVE",
        "createdOn": 1713841339.861000000,
        "createdBy": 75086856,
        "lastUpdatedOn": 1713841339.861000000,
        "lastUpdatedBy": 75086856,
        "customFields": {},
        "active": true
    },
    "errors": null,
    "warnings": null
}
{
    "data": {
        "id": "662755fd8fe258516a88fedf",
        "orgId": 100606,
        "name": "Badge_Issue_earntype12",
        "description": "Make 5 transactions in a month, get a badge and 10% off coupon",
        "startOn": 1736803487.000000000,
        "expiresOn": 1746804000.000000000,
        "earnedBadgeExpiry": {
            "expiryType": "RELATIVE",
            "relativeExpirytype": "WEEKS",
            "value": 2
        },
        "issuedBadgeExpiry": {
            "expiryType": "ABSOLUTE",
            "type": "FIXED_DATE",
            "expiresOn": 1926235957.000000000,
            "expireWithBadgeMeta": false
        },
        "images": [],
        "ownership": {
            "restrictedToOwners": [
                "Audience_Campaigns",
                "Loyalty"
            ],
            "claims": []
        },
        "customerConstraints": [
            {
                "constraintType": "CUSTOMER_BADGE_FIXED_WINDOW",
                "referenceId": "e6791ec9-e92f-34af-bdc3-be2607fdf82c",
                "durationType": "DAYS",
                "refreshRate": 3,
                "maxEarnLimit": 2,
                "cycleStatus": "UPCOMING",
                "startDate": 1736803487.000000000,
                "endDate": 1926235957.000000000
            }
        ],
        "badgeConstraints": [
            {
                "constraintType": "BADGE_FIXED_VALUE",
                "maxEarnLimit": 10000
            },
            {
                "constraintType": "BADGE_ROLLING_WINDOW",
                "rollType": "WEEKS",
                "rollValue": 1,
                "maxEarnLimit": 3000
            },
            {
                "constraintType": "BADGE_ROLLING_WINDOW",
                "rollType": "DAYS",
                "rollValue": 1,
                "maxEarnLimit": 300
            }
        ],
        "benefits": [
            {
                "benefitType": "COUPON",
                "seriesId": 13745
            }
        ],
        "tags": [],
        "badgeGroupId": null,
        "badgeRank": null,
        "earnType": "ISSUE_EARN",
        "status": "UPCOMING",
        "createdOn": 1713853949.310000000,
        "createdBy": 75097962,
        "lastUpdatedOn": 1713853949.310000000,
        "lastUpdatedBy": 75097962,
        "customFields": {
            "2024": "true",
            "Date": "2025-01-18T09:09:09Z"
        },
        "active": true
    },
    "errors": null,
    "warnings": null
}

API-specific error codes

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