API: Campaigns

The Campaigns API methods allow for retrieving information about campaigns.

Attributes

Public (always available)

  • id - identifier - An identifier for the campaign. This will never change.
  • slug - string - A URL-friendly slug for the campaign. The user can change this.
  • campaign_url - string - The URL to the campaign homepage.
  • visibility - string - The visibility of the campaign. Can be 'public', 'friends', or 'private'
  • game_master - user mini-object - The game master of the campaign
  • created_at - timestamp - Indicates when the campaign was first created. ISO-8601 timestamp
  • updated_at - timestamp - Indicates when the campaign was last updated. ISO-8601 timestamp

Public / Private / Friends Visibility (availability depends on visibility)

  • banner_image_url - string - The URL to the campaign banner.
  • play_status - string - The current play status of the campaign
  • players - array - An array of user mini-objects for the campaign's players
  • fans - array - An array of user mini-objects for the campaign's fans
  • looking_for_players - boolean - A flag to indicate if the campaign is looking for players
  • location object - A JSON object containing: { lat and lng } representing the campaign's "Where We Game" location.

Methods

Show

URL: http://api.obsidianportal.com/v1/campaigns/id.format
HTTP Verb: GET
Requires Authentication: Yes
Required Parameters:

  • id - identifier - The id (or slug, see use_slug below) of the campaign to request

Optional Parameters:

  • use_slug - boolean - If set to 'true' or '1', this indicates that the id passed in is actually the campaign slug and to look it up by slug.

Response: A single campaign.

Example

Request

http://api.obsidianportal.com/v1/campaigns/453d0788f20111df8ad4d49a20038434.json

Response

{
 'id' : '453d0788f20111df8ad4d49a20038434',
 'name' : 'Kensing',
 'slug' : 'kensing',
 'campaign_url' : 'http://www.obsidianportal.com/campaigns/kensing',
 'visibility' : 'public',
 'game_master' : {
  'id' : 'b777d6b6f266f2638853636baf8575453fb9417a',
  'username' : 'Micah',
  'profile_url' : 'http://www.obsidianportal.com/profile/Micah',
  'avatar_image_url' : 'http://cdn.obsidianportal.com/foo/bar/myface.jpg'
 }
 'play_status' : 'on_hiatus',
 'players' : [
  {
   'id' : 'a123d6b6f266f2638853636baf8575453fb9417a',
   'username' : 'Player1',
   'profile_url' : 'http://www.obsidianportal.com/profile/Player1'
  },
  {
   'id' : 'b123d6b6f266f2638853636baf8575453fb9417a',
   'username' : 'Player2',
   'profile_url' : 'http://www.obsidianportal.com/profile/Player2'
  }
 ],
 'fans' : [
  {
   'id' : 'c123d6b6f266f2638853636baf8575453fb9417a',
   'username' : 'Fan1',
   'profile_url' : 'http://www.obsidianportal.com/profile/Player2',
   'avatar_image_url' : 'http://cdn.obsidianportal.com/foo/bar/somepic.png'
  },
  {
   'id' : 'd123d6b6f266f2638853636baf8575453fb9417a',
   'username' : 'Fan2',
   'profile_url' : 'http://www.obsidianportal.com/profile/Player2'
  }
 ],
 'looking_for_players' : false,
 'created_at' : '2007-07-04T12:00:00Z',
 'updated_at' : '2010-10-28T12:22:00Z',
 'location' : {
  'lat' : 33.7759,
  'lng' : -84.3927
 }
}