Cogblog

The Official Blog of Cogmap, the Org Chart Wiki

 

Archive for the ‘Cogmap APIs’ Category

 

Cogmap API Update July 2008

Tuesday, July 22nd, 2008

Cogmap is pleased to introduce the first significant changes to the Cogmap APIs since their introduction.

These changes incorporate our new URL schemes and also support application authentication.

Here is the low-down:

Organization Chart Data is accessible as an XOXO document by calling a URL formatted as http://www.cogmap.com/xoxo/<CHART NAME>

This returns a nested set of unordered lists that describes the organization. Each listed item also contains several pieces of metadata associated with the list. The format is:

<li><a href=”profile.php?id=<personID>”> <FirstName> <LastName> </a> <dl> <dt>Title</dt> <dd><TitleValue></dd> <dt>CogID</dt> <dd><personID></dd> </dl>

  • personID: the ID in Cogmap’s database
  • FirstName: Person’s first name
  • LastName: Person’s last name
  • TitleValue: Person’s title
  • The title of the document is the chart’s name.

So here is an awesome example: XOXO No Inc Chart!

There are a number of other interesting things you can do:

  • If you weren’t sure, for some reason, how Cogmap has changed the name of a company into the URL schema that Cogmap uses, you can tell it to guess by setting the interpret flag.  This might look like: http://www.cogmap.com/xoxo/no inc?interpret=1 and it will take a shot.  If it fails, or if, in general, Cogmap doesn’t recognize what you are looking for, a 404 is returned.
  • All of Cogmap’s APIs, and for that matter, all of the pages that are protected by access control, can now be accessed programmatically.  On every member’s user settings page there is an “API Key”.  Using your user name and API key will allow you to access protected pages programmatically by adding the following to your “GET” query string:
    • user=<username>
    • apikey=<api key>

All of these APIs still work:

hCards & vCards

  • Every profile page is actually an hCard. Munch it, crunch it, consume it.
  • You can download vCards easy too. http://www.cogmap.com/vcard.php?id=<ID of Profile>

Newsfeed API

  • Consume your newsfeed! http://www.cogmap.com/newsfeed_xoxo.php?cogid=<your screen name> returns an XOXO XML document of your newsfeed. This makes it easy to turn your newsfeed into something consumed by other applications. Here is my newsfeed as an example.

Cogmap APIs

Tuesday, March 4th, 2008

UPDATE: Significant changes have taken place. Here is the latest: http://www.cogmap.com/blog/2008/07/21/cogmap-api-update-july-2008cogmap-api-update-july-2008/

This is a unified post to point to all of our APIs. Each title links to more comprehensive documentation.

XOXO Organization Charts

Every Cogmap org chart is available as an XOXO document.

Organization Chart Data is accessible as an XOXO document by calling a URL formatted as http://www.cogmap.com/xoxo.php?id=<CHART ID>

xoxo.php returns a nested set of unordered lists that describes the organization. Each listed item also contains several pieces of metadata associated with the list:

  • personID: the ID in Cogmap’s database
  • FirstName: Person’s first name
  • LastName: Person’s last name
  • TitleValue: Person’s title
  • The title of the document is the chart’s name.

Name-based APIs

  1. http://www.cogmap.com/nameapi.php?chart=<Name of Company> will return either the map of that page or a page to create a new chart.
  2. http://www.cogmap.com/xoxonameapi.php?chart=<Name of Company> will return either the XOXO XML document of the organization structure of that company or a 404 error.
  3. http://www.cogmap.com/numbernameapi.php?chart=<Name of Company> will return the unique identifier of the chart ID for that company or a 404 error.

hCards & vCards

  1. Every profile page is actually an hCard. Munch it, crunch it, consume it.
  2. You can download vCards easy too. http://www.cogmap.com/vcard.php?id=<ID of Profile>

Newsfeed API

  1. Consume your newsfeed! http://www.cogmap.com/newsfeed_xoxo.php?cogid=<your screen name> returns an XOXO XML document of your newsfeed. This makes it easy to turn your newsfeed into something consumed by other applications. Here is my newsfeed as an example.

Name-based APIs

Tuesday, August 14th, 2007

UPDATE: All of this has been deprecated: http://www.cogmap.com/blog/2008/07/21/cogmap-api-update-july-2008cogmap-api-update-july-2008/

New features for programmers trying to do things with Cogmap: Name-based map identification! It works like this:

  1. http://www.cogmap.com/nameapi.php?chart=<Name of Company> will return either the map of that page or a page to create a new chart.
  2. http://www.cogmap.com/xoxonameapi.php?chart=<Name of Company> will return either the XOXO XML document of the organization structure of that company or a 404 error.
  3. http://www.cogmap.com/numbernameapi.php?chart=<Name of Company> will return the unique identifier of the chart ID for that company or a 404 error.

Here is an example for Google: http://www.cogmap.com/xoxonameapi.php?chart=Google
This will allow programmers to integrate applications much more easily. If you want to use our chrome and make it easy for people to extend and update maps, just direct them to our pages with nameapi.php. If you are trying to consume Cogdata but want to capture it using names, then xoxonameapi.php will make it easy to access our data structure using only the names of companies.

The name field, because it is editable in the wiki, is a less reliable field than the unique identifier we assign each map. If you want to create static links to specific maps, it is better to use that maps chart ID. If you wanted to spider the site for all the chart IDs and map names, the best way to do that would probably be to consume and parse the alphabetical list: http://www.cogmap.com/alpha.php

For the numbernameapi.php, if a chart exists, it returns the number (CHART ID) of that chart, which could then be used to call the chart page (http://www.cogmap.com/chart.php?id=<CHART ID>) or the XML document (http://www.cogmap.com/xoxo.php?id=<CHART ID>).

Definitely shoot us emails if you build public applications using this. We love to share whatever SEO juice we have.

Organization Chart API: XOXO XML charts!

Sunday, June 17th, 2007

UPDATE: Massive changes to this: http://www.cogmap.com/blog/2008/07/21/cogmap-api-update-july-2008cogmap-api-update-july-2008/

Organization Chart Data is accessible as an XOXO document by calling a URL formatted as http://www.cogmap.com/xoxo.php?id=<CHART ID>

xoxo.php returns a nested set of unordered lists that describes the organization. Each listed item also contains several pieces of metadata associated with the list. The format is:

<li><a href=”profile.php?id=<personID>”> <FirstName> <LastName> </a> <dl> <dt>Title</dt> <dd><TitleValue></dd> <dt>CogID</dt> <dd><personID></dd> </dl>

  • personID: the ID in Cogmap’s database
  • FirstName: Person’s first name
  • LastName: Person’s last name
  • TitleValue: Person’s title
  • The title of the document is the chart’s name.

So here is an awesome example: XOXO No Inc Chart!

Hopefully this starts to satisfy the data-consumers out there like Stamen Design, who were emailing ideas for how to implement this virtually from launch.

Let the gobbling of organizational data begin! Make sure you post something here or send us email if you do something cool.