Code | Description |
---|---|
401 | Unauthorized - ensure token is being passed with each service call. |
404 | Unsupported operation |
500 | Unspecified error on server. |
(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>
Param name | Description |
---|---|
organization_token required |
Unique organization token required to generate a user token for future API calls. Validations:
|
email required |
Email address of the new user Validations:
|
password required |
Password for the new user Validations:
|
password_confirmation required |
Password again to ensure user didn't make a mistake Validations:
|
first_name required |
First name. Validations:
|
last_name required |
Last name. Validations:
|