Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7518415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:44:50+00:00 2026-05-30T01:44:50+00:00

For recent checkins it is pretty straightforward: Dim UserSelfCheckins As FourSquare.UserSelfCheckins.Root Dim ser As

  • 0

For recent checkins it is pretty straightforward:

Dim UserSelfCheckins As FourSquare.UserSelfCheckins.Root
Dim ser As New JavaScriptSerializer()
UserSelfCheckins = ser.Deserialize(Of FourSquare.UserSelfCheckins.Root)(jsonstring)

With backing classes like this:

Namespace UserSelfCheckins
    Public Class Root
        Public Property meta As MetaProperties
        Public Property response As ResponseProperties
    End Class

    Public Class MetaProperties
        Public Property code As String
    End Class

    Public Class ResponseProperties
        Public Property checkins As UserSelfCheckins
    End Class

    Public Class UserSelfCheckins
        Public Property count As Integer
        Public Property items As List(Of UserSelfCheckinProperties)
    End Class

    Public Class UserSelfCheckinProperties
        Public Property createdAt As Long
        Public Property venue As VenueProperties
    End Class

    Public Class VenueProperties
        Public Property id As String
        Public Property name As String
        Public Property location As LocationProperty
        Public Property categories As List(Of CategoriesProperty)
    End Class

    Public Class LocationProperty
        Public Property city As String
        Public Property state As String
    End Class
End Namespace

You can display them with this:

 @For Each item In UserSelfCheckins.response.checkins.items
        @<li>
        @item.venue.name
        @item.venue.location.city
        @item.venue.location.state
        </li>
 Next

What I can’t figure out is how to do this for the list of badges as the structure isn’t constant. It is Response>Badges>[badgeID]>BadgeName. Since the BadgeID is different for each one I am having trouble writing matching classes.

After that figuring i’ll need to figure out a reasonable way to show badges that are actually unlocked.

Here is a snippet of the JSON from 2 badges – one unlocked.

{
  "meta": {
    "code": 200
  },
  "response": {
    "badges": {
      "4cd0d5e2137c76b04864e9c5": {
        "id": "4cd0d5e2137c76b04864e9c5",
        "badgeId": "4c4f08667a0803bb02212ab7",
        "name": "Groupie",
        "description": "The Backstreet Boys of tech! The Menudo of the interne.... OMG! @NAVEEN JUST TOUCHED MY SHIRT!\n\n",
        "image": {
          "prefix": "https:\/\/plaayfoursquare.s3.amazonaws.com\/badge\/",
          "sizes": [
            57,
            114,
            200,
            300,
            400
          ],
          "name": "\/sxsw2010_groupie.png"
        },
        "unlocks": [
          {
            "checkins": [

            ]
          }
        ]
      },
      "4cb271c2c5e6a1cd61d2e5f6": {
        "id": "4cb271c2c5e6a1cd61d2e5f6",
        "badgeId": "4c4f08667a0803bb17212ab7",
        "name": "Barista",
        "description": "Congrats - you've checked in at 5 different Starbucks! Be sure to pick up a double tall latte for your friend - I'm sure they'd do the same for you.",
        "image": {
          "prefix": "https:\/\/playfoursquare.s3.amazonaws.com\/badge\/",
          "sizes": [
            57,
            114,
            200,
            300,
            400
          ],
          "name": "\/barista.png"
        },
        "unlocks": [
          {
            "checkins": [
              {
                "id": "4cb271c1c5e6a1cd5ed2e5f6",
                "createdAt": 1286762945,
                "type": "checkin",
                "timeZone": "America\/Los_Angeles",
                "venue": {
                  "id": "4b4aa5c0f964a520318c26e3",
                  "name": "Starbucks",
                  "contact": {
                    "twitter": "starbucks"
                  },
                  "location": {
                    "address": "B Gates, Terminal 1",
                    "crossStreet": "LAS Airport",
                    "lat": 36.083164640690136,
                    "lng": -115.1517391204834,
                    "postalCode": "89119",
                    "city": "Las Vegas",
                    "state": "NV",
                    "country": "United States"
                  },
                  "categories": [
                    {
                      "id": "4bf58dd8d48988d1e0931735",
                      "name": "Coffee Shop",
                      "pluralName": "Coffee Shops",
                      "shortName": "Coffee Shop",
                      "icon": {
                        "prefix": "https:\/\/foursquare.com\/img\/categories\/food\/coffeeshop_",
                        "sizes": [
                          32,
                          44,
                          64,
                          88,
                          256
                        ],
                        "name": ".png"
                      },
                      "primary": true
                    }
                  ],
                  "verified": false,
                  "stats": {
                    "checkinsCount": 1401,
                    "usersCount": 1282,
                    "tipCount": 13
                  }
                },
                "photos": {
                  "count": 0,
                  "items": [

                  ]
                },
                "comments": {
                  "count": 0,
                  "items": [

                  ]
                }
              }
            ]
          }
        ]
      }
    },
    "defaultSetType": "foursquare"
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:44:51+00:00Added an answer on May 30, 2026 at 1:44 am

    I think I figured it out. What I was missing was turning the badges level into dictionary of string and object.

    I needed this model:

     Namespace UserBadges
        Public Class Root
            Public Property meta As MetaProperties
            Public Property response As ResponseProperties
        End Class
    
        Public Class MetaProperties
            Public Property code As String
        End Class
    
        Public Class ResponseProperties
            Public Property badges As Dictionary(Of String, badge)
        End Class
    
        Public Class badge
            Public Property name As String
            Public Property Description As String
            Public Property Image As BadgeImage
            Public Property unlocks As List(Of Checkins)
        End Class
    
        Public Class Checkins
            Public Property checkins As List(Of CheckinInfo)
        End Class
    
        Public Class CheckinInfo
            Public Property createdAt As String
        End Class
    
        Public Class BadgeImage
            Public Property prefix As String
            Public Property name As String
        End Class
    
    End Namespace
    

    And this:

     UserBadges = ser.Deserialize(FourSquare.UserBadges.Root)(FSQjson)
     For Each item In UserBadges.response.badges
          @item.Value.Image.prefix
          @item.Value.Image.name
          @item.Value.name
          @item.Value.Description     
     Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm requesting a user's checkins at the following endpoint: https://api.foursquare.com/v2/users/self/checkins Items returned are ordered
I'm using the api @ api.foursquare.com/v2/users/USER_ID/checkins referenced here developer.foursquare.com/docs/users/checkins I am creating the request
In recent versions, OpenCV allows easy creation of keypoint detectors, descriptors or matchers using
In recent versions of python, one can use something like with open('abc.txt') as f:
The recent upgrade to Dreamweaver CS5.5 finally installs the Android SDK correctly, but when
The recent update (V 20.x) of Chrome has broken one of my forms with
Following recent hardware problems, I attempted to switch a couple of our websites to
A recent problem* left me wondering whether there is a text editor out there
A recent post by John Gruber notes that the following legalese: 3.3.1 — Applications
A recent question contains a problem that I many times used to think about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.