Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Authentication API

Tim Morgan edited this page Jan 26, 2015 · 1 revision

There is a special authentication resource available at /authentications.

This endpoint could be used to implement a Single Sign-On (SSO) system.

You must first authenticate to the API as a super user using HTTP basic auth.

Details

Required parameters:

  • authentication[email]
  • authentication[password]

Possible return values are:

  • 201, authenticated person as xml
  • 401, unauthorized (incorrect password)
  • 404, not found (email address not found)
  • 400, bad request – bad api authentication or not a super user

Curl Example

curl -u [email protected]:APIKEY http://example.com/authentications -F authentication[email][email protected] -F authentication[password]=password

ActiveResource Example

require 'rubygems'
require 'active_resource'

class Authentication < ActiveResource::Base
  self.site = 'http://example.com'
  self.user = '[email protected]'
  self.password = 'APIKEY'
end

auth = Authentication.new
auth.email = '[email protected]'
auth.password = 'password'
auth.save