Supported Formats

json, xml

Errors

Code Description
401 Unauthorized - ensure token is being passed with each service call.
404 Unsupported operation
500 Unspecified error on server.

Examples

(json) POST {"first_name":"Somefirstname","last_name":"Somelastname","email":"test@test.org","password":"passw0rd","password_confirmation":"passw0rd","organization_token":"1234TokenGoesHere"}
(json) POST https://buildingenergyscore.energy.gov/api/v2/users?first_name=Somefirstname&last_name=Somelastname&email=test@test.org&password=passw0rd&password_confirmation=passw0rd&organization_token=1234TokenGoesHere
(json) Response: {"created_at":"2013-07-31T22:53:44Z","email":"newuser@nowhere.com","id":15,"organization_id":1,"role_id":1,"updated_at":"2013-07-31T22:53:44Z"}
(xml) POST https://buildingenergyscore.energy.gov/api/v2/users.xml?first_name=Somefirstname&last_name=Somelastname&email=test@test.org&password=passw0rd&password_confirmation=passw0rd&organization_token=1234TokenGoesHere
(xml) Response:
<user>
  <created-at type="datetime">2014-01-30T23:28:08Z</created-at>
  <email>test@test.org</email>
  <id type="integer">30</id>
  <organization-id type="integer">1</organization-id>
  <role-id type="integer">1</role-id>
  <updated-at type="datetime">2014-01-30T23:28:08Z</updated-at>
</user>

Params

Param name Description
organization_token
required

Unique organization token required to generate a user token for future API calls.

Validations:

  • Must be a String

email
required

Email address of the new user

Validations:

  • Must be a String

password
required

Password for the new user

Validations:

  • Must be a String

password_confirmation
required

Password again to ensure user didn't make a mistake

Validations:

  • Must be a String

first_name
required

First name.

Validations:

  • Must be a String

last_name
required

Last name.

Validations:

  • Must be a String