README.rdoc

Path: README.rdoc
Last Update: Tue Mar 09 15:18:41 -0500 2010

Introduction

The Bloomfire API is provided via a simple restful interface with xml responses. Each api call maps to a url within the account‘s subdomain under the /api path. For example: myorgname.bloomfire.com/api/courses

Every call requires an admin‘s username and password to be specified via Basic HTTP authentication. Parameters should be specified as request parameters unless otherwise specified.

Get Published Courses

  GET /api/courses/published
  Requires SSL: No

parameters

  limit:              The maximum number of courses to include in the response.  (optional: defaults to all published courses)
  image_expiration:   The amount of time in seconds the course thumbnail urls will be valid.  Course thumbnail urls are temporary
                      to protect them from being permenantly linked to or shared outside of the organization.

response

  <courses type="array">
    <course>
      <name>A Course Title</name>
      <description>A description for this course.</description>
      <thumbnail-url>http://s3.amazonaws.com/content-production/temporary/path/pic.png</thumbnail-url>
      <author>Jack Johnson</author>
      <course-url>http://myorgname.bloomfire.com/courses/123</course-url>
      <published-at>2010-03-02 13:36:24 -0500</published-at>
      <id>123</id>
    </course>

    <course>
      ...
    </course>
    ...
  </courses>

Create User

  POST /api/memberships
  Content Type: application/xml
  Requires SSL: Yes

parameters

  email:           The email address of the user. (required)
  password:        The password to use. (optional: defaults to a random password)
  first-name:      The first name of the user. (required)
  last-name:       The last name of the user. (required)
  title:           The occupational title of the user. (optional)
  bio:             The description or biography of the user. (optional)

  <request>
    <membership>
      <email>john@doe.com</email>
      <first-name>John</first-name>
      <last-name>Doe</last-name>
      <password>theirpassword</password>
      <title>Learning Evangelist</title>
      <bio>All about me</bio>
    </membership>
  </request>

example

  curl --user user@email.com \
  https://myorg.bloomfire.com/api/memberships \
  --data "<request><membership><first-name>James</first-name><last-name>Bond</last-name><email>james.bond@gmail.com</email></membership></request>" \
  -H "Content-Type: application/xml"

response

  HTTP Code: 201

  <response>
    <success type="boolean">true</success>
    <email>john@doe.com</email>
    <id type="integer">22</id>
    <password>theirpassword</password>
  </response>

error

  HTTP Code: 500

  <response>
    <errors>
      <error>User email has already been taken</error>
    </errors>
    <success type="boolean">false</success>
  </response>

Analytics

  GET /api/analytics
  Requires SSL: No

parameters

  None

response

  Views This Month:     Returns the aggregate of all the course viewings in the last 30 days.
  Learners:             Returns the top 5 learners for the last 30 days.
  Teachers:             Returns the top 5 teachers for the last 30 days.
  Courses:              Returns the top 5 courses for the last 30 days.

  <response>
    <views-this-month>223</views-this-month>
    <learners type="array">
      <learner>
        <first-name>Mika</first-name>
        <last-name>Alis</last-name>
        <views type="integer">23</views>
        <profile-url>http://myorg.bloomfire.com/memberships/1</profile-url>
        <id type="integer">1</id>
      </learner>
      ...
    </learners>
    <teachers type="array">
      <teacher>
        <first-name>Justone</first-name>
        <last-name>TheWind</last-name>
        <views type="integer">19</views>
        <profile-url>http://myorg.bloomfire.com/memberships/3</profile-url>
        <id type="integer">2</id>
      </teachers>
      ...
    </teachers>
    <courses type="array">
      <course>
        <name>Guitar Lessons</name>
        <id type="integer">45</id>
        <course-url>http://myorg.bloomfire.com/courses/45</course-url>
        <views type="integer">87</views>
      </course>
    </courses>
  </response>

[Validate]