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

{
  "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
        }
      }
    ],
    "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!