Previous: Roles | Up: Introduction | Next: Services

Users

Retrieving User List

Request Format:

GET /api/1/users.[json|xml]

Response Format:

On success, returns 200 (Success) and this content:

<?xml version="1.0" encoding="UTF-8"?> <objects type="array"> <object> <userId type="integer">5327</userId> <organizationId type="integer">3938</organizationId> <firstName>Eric</firstName> <lastName>Monkey</lastName> <preferredName>Eban</preferredName> <login>ebanana</login> <teamforgeLogin>1234</teamforgeLogin> <email>ebanana@example.com</email> <description nil="true"/> <contactPhone>123-456-789</contactPhone> <contactAddress1>123 Nowhere St</contactAddress1> <contactAddress2>Past the black stump</contactAddress2> <contactCity>Nowheresville</contactCity> <contactState>ABC</contactState> <contactPostalCode>12345</contactPostalCode> <contactCountry nil="true"/> <status>active</status> <createDate>2013-04-09T19:33:40Z</createDate> <lastLogin nil="true"/> <lastPasswordChange>2013-04-09T19:33:40Z</lastPasswordChange> </object> <object> <userId>...</userId> </object> </objects>
[ { "userId": 5327, "organizationId": 3938, "firstName": "Eric", "lastName": "Monkey", "preferredName": "Eban", "login": "ebanana", "teamforgeLogin": "1234", "email": "ebanana@example.com", "description": null, "contactPhone": "123-456-789", "contactAddress1": "123 Nowhere St", "contactAddress2": "Past the black stump", "contactCity": "Nowheresville", "contactState": "ABC", "contactPostalCode": "12345", "contactCountry": null, "status": "active", "createDate": "2013-04-09T19:33:40Z", "lastLogin": null, "lastPasswordChange": "2013-04-09T19:33:40Z" }, { "userId": "..." } ]

Retrieving Specific User

Request Format:

GET /api/1/users/[ID].[json|xml]

Use "current" as the [ID] to retrieve the current user.

GET /api/1/users/current.[json|xml]

Response Format:

On success, returns 200 (Success) and this content:

<?xml version="1.0" encoding="UTF-8"?> <hash> <user> <userId type="integer">5327</userId> <organizationId type="integer">3938</organizationId> <firstName>Eric</firstName> <lastName>Monkey</lastName> <preferredName>Eban</preferredName> <login>ebanana</login> <teamforgeLogin>1234</teamforgeLogin> <email>ebanana@example.com</email> <description nil="true"/> <contactPhone>123-456-789</contactPhone> <contactAddress1>123 Nowhere St</contactAddress1> <contactAddress2>Past the black stump</contactAddress2> <contactCity>Nowheresville</contactCity> <contactState>ABC</contactState> <contactPostalCode>12345</contactPostalCode> <contactCountry nil="true"/> <status>active</status> <createDate>2013-04-09T19:33:40Z</createDate> <lastLogin nil="true"/> <lastPasswordChange>2013-04-09T19:33:40Z</lastPasswordChange> </user> <links type="array"> <link> <rel>self</rel> <href>/api/1/users/1</href> </link> <link> <rel>users</rel> <href>/api/1/users</href> </link> </links> </hash>
{ "user": { "userId": 5327, "organizationId": 3938, "firstName": "Eric", "lastName": "Monkey", "preferredName": "Eban", "login": "ebanana", "teamforgeLogin": "1234", "email": "ebanana@example.com", "description": null, "contactPhone": "123-456-789", "contactAddress1": "123 Nowhere St", "contactAddress2": "Past the black stump", "contactCity": "Nowheresville", "contactState": "ABC", "contactPostalCode": "12345", "contactCountry": null, "status": "active", "createDate": "2013-04-09T19:33:40Z", "lastLogin": null, "lastPasswordChange": "2013-04-09T19:33:40Z" }, "links": [ { "rel": "self", "href": "/api/1/users/1" }, { "rel": "users", "href": "/api/1/users" } ] }

Creating A User

Request Format:

POST /api/1/users.[json|xml]

Parameters:

* login must be unique within the organization. Additionally, it may not be a reserved word. The following values are reserved: accessfile, cvs, cvsroot, attic, git, gitweb, gitweb_config, default, root, daemon, www-data, nobody, cloudforge, codesion, cvsdude, copyright, swjars, cloudforge

Response Format:

On success, returns 201 (Created) response code along with this content:

<?xml version="1.0" encoding="UTF-8"?> <hash> <responseHeader> <userId type="integer">2</userId> </responseHeader> <links type="array"> <link> <rel>self</rel> <href>/api/1/users/2</href> </link> <link> <rel>users</rel> <href>/api/1/users</href> </link> </links> </hash>
{ "responseHeader": { "userId": 2 }, "links": [ { "rel": "self", "href": "/api/1/users/2" }, { "rel": "users", "href": "/api/1/users" } ] }

Updating A User

PUT /api/1/users/[userId].[json|xml]

Parameters:

You may provide any sub-set of these parameters for update. In most cases, you can provide an empty value in order to remove the property. Properties marked "required if present," however, must have values, not empty strings, if the property is mentioned.

Response Format:

On success, returns 200 (Success) response code along with this content:

<?xml version="1.0" encoding="UTF-8"?> <hash> <responseHeader> <userId type="integer">2</userId> </responseHeader> <links type="array"> <link> <rel>self</rel> <href>/api/1/users/2</href> </link> <link> <rel>users</rel> <href>/api/1/users</href> </link> </links> </hash>
{ "responseHeader": { "userId": 2 }, "links": [ { "rel": "self", "href": "/api/1/users/2" }, { "rel": "users", "href": "/api/1/users" } ] }

Deleting A User

Request Format:

DELETE /api/1/users/[userId].[json|xml]

Response Format:

On success, returns 200 (Success) response code along with this content:

<?xml version="1.0" encoding="UTF-8"?> <hash> </hash>
{ }