Skip to content

User Badges

The User Badges provides app developers with comprehensive badge data to build custom achievement systems in their iOS applications. Upshot.ai provides a user-specific list of all earned and yet-to-be-earned badges data. Using this data, you can implement a comprehensive Badges section in your application to showcase user achievements and motivate continued engagement.

Overview

The User Badges API provides developers with:

  • Earned Badges Data - Complete collection of badges the user has successfully earned
  • Available Badges Data - Badges that are available but not yet earned (with progress tracking)

How to Fetch User Badges

Request user badges data:

objective-c
@import Upshot;

// Fetch user badges
[[BrandKinesis sharedInstance] getUserBadges];
swift
import Upshot

// Fetch user badges
BrandKinesis.sharedInstance(). getUserBadges()

Response Structure

The user badges response contains two main arrays:

Active List (Earned Badges)

Badges that the user has already earned:

json
{
  "active_list": [
    {
      "achivedTime": 1493892162263,
      "activityName": "Badge1",
      "badge": "590c28142b2f15cf1b7b23d3590c39c12b2f15a7517b23c9",
      "badgeDesc": "YOU HAVE WON A FREE PIZZA FROM US :)",
      "badgeImage": "{128, 128}",
      "campaignName": "Campaign1",
      "status": 1,
      "tags": ["Welcome"],
      "title": "CONGRATULATIONS!!!"
    }
  ]
}

Inactive List (Available Badges)

Badges that are available but not yet earned:

json
{
  "inactive_list": [
    {
      "activityName": "Badge2",
      "badge": "590c397c2b2f15a9517b23c6590c3e5a2b2f152b5a7b23cc",
      "badgeDesc": "You have received two free movie tickets! To accept them, please click the okay button.",
      "badgeImage": "{128, 128}",
      "campaignName": "Campaign2",
      "status": 2,
      "tags": ["Welcome"],
      "title": "Dear Customer!!!"
    }
  ]
}

Response Field Descriptions

FieldDescription
active_listArray of badges the user has earned
inactive_listArray of badges available but not yet earned
achivedTimeTimestamp when badge was earned (only in active_list)
activityNameInternal name of the badge activity
badgeUnique badge identifier
badgeDescDescription text for the badge
badgeImageBadge image dimensions/reference
campaignNameCampaign this badge belongs to
statusBadge status (1 = earned, 2 = available)
tagsArray of tags associated with the badge
titleDisplay title for the badge

Powered by Upshot.ai