User REST API

What is Rest (Representational State Transfer)?: It's an architectural style, not a standard. Find out more in the Wikipedia or read the following article if you want to know about REST in Rails

What do you need to access our REST API? You just need to know how to send  HTTP requests with basic authentication to our servers from your application.

TABLE OF CONTENTS

  • User Rest API
    • User XML Representation
    • Best profile (GET)


USER REST API

 

USER XML REPRESENTATION

<user>
<id>aRIULIPCWr2Oq0aaeP0Qfc</id>
<login_name>andy</login_name>
<email>info@assembla.com</email>
<organization>Assembla</organization>
<website>www.assembla.com</website>
<phone>1.781.328.2241</phone>
<first_im>
<type>Yahoo</type>
<id>asinglenet</id>
</first_im>
<second_im>
<type>Skype</type>
<id>andysingleton</id>
</second_im>
</user>

Note: You may not see all the attributes for a user. Information availability depends on user's choice. The only attributes which are always present are: id and login

 

BEST PROFILE (GET)

To access a user profile you need to send a GET request to: http://www.assembla.com/user/best_profile/<user_id>

Where <user_id> is the id of the user you want to get the information about. Profile's information availability may change depending on user's permissions. You can access a user's public information if you send the request without authentication but if you authenticate yourself using http basic authentication you may get more information from the profile.

If you want to get the response in xml format, be sure to include "Accept:application/xml" in your request header.

 

Example using curl for public profile

curl -i -X GET -H "Accept: application/xml" http://www.assembla.com/user/best_profile/aRIULIPCWr2Oq0aaeP0Qfc

 

Example using curl for permissioned profile

curl -i -X GET -H "Accept: application/xml" http://user:password@www.assembla.com/user/best_profile/aRIULIPCWr2Oq0aaeP0Qfc

(Note: http://user:password@www.assembla.com/ is the way you use basic authentication with curl. You need to find out how to use it with your application)


RESPONSE: If the user is found you will get an xml representation of him, otherwise, you will get a 404 Not Found Status in the response

No comments yet. post a comment >