Documentation

Articles » How to store userdata using machine tags

How to store userdata using machine tags

March 3rd, 2011 by Colin Devroe

spacer We’re often asked by third-party developers how to store userdata from their community within Viddler. We are asked questions like “How do I know a video is owned by a particular user on our network?” Well, this is how we often advise these developers to handle this issue.

First, you have to choose a unique identifier for that user in your community. That might be a username or an ID of some kind. Once you’ve chosen that unique identifier the process to store that information on Viddler using the API is super simple. We recommend using machine tags.

What is a machine tag? A machine tag is a special, machine readable tag format that consists of name:predicate=value. In other words, it is a unique-to-you tag that helps you to identify a specific piece of information about that tag. Lets run through a few examples…

Lets say that you’re running a site that features user-contributed music videos. We’ll call your site, Music Video Site. Awesome name, we know. Each of your website’s users have the ability to upload music videos of their own to your site using our API. How would you know which videos that user johndoe owns? By simply adding a single machine tag, such as, musicvideosite:user=johndoe you’d be able to quickly identify which videos are theirs.

You can set that tag on upload using the API or add it later using the viddler.videos.setDetails method. To retrieve those videos later you can use the viddler.videos.getByUser method using the tags=musicvideosite:user=johndoe argument. Remember, by including a valid sessionid with that call you can also retrieve private videos from that user if you need to.

This methodology is not limited to only storing user data. You can also use it for other useful things like categories, genres, sets, etc. Here are the machine tags you could use for those:

  • musicvideosite:category=music
  • musicvideosite:genre=rock
  • musicvideosite:set=demos

The possibilities are endless!

We hope this article helps those of you with your own communities to store and retrieve metadata specific to you in a quick an easy way. If not, join the Mailing List and let us know how we can improve this article.

Search

Navigation

  • Up a level
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.