API Introduction

1. Introduction

The FeedbackRoad API is implemented as Post Variables and XML over HTTP using all four verbs (GET/POST/PUT/DELETE). Every resource, like Users, Ideas etc, has their own URL and are manipulated in isolation. In other words, we've tried to make the API follow the REST principles as much as we can.

2. Authentication

Authentication is managed using HTTP authentication (only "Basic" is supported right now). Every request must include the Authorization HTTP header. Use your API token as the username, and "X" (or some otherwise bogus text) as the password (only the API token is used for authenticating API requests).
Example CURL
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \ -u 123638dc733ceaf75130303fe6e6010f63868bc0:X -d '<user><user_email>test@yahoo.com</user_email></user>' http://yoururl.feedbackroad.com/users.xml

3. Making requests

Set the 'Content-Type' to 'application/xml' and 'Accept' to 'application/xml' to identify the request and response format.
Example CURL
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \ -u 123638dc733ceaf75130303fe6e6010f63868bc0:X \ -d '<user><user_email>test@yahoo.com</user_email></user>' \ http://yoururl.feedbackroad.com/api/v1/users.xml

4. Responses

If a request succeeds, it will return a status code in the 200 range and often, an XML-formatted response. Note that, in general, if a request causes a new record to be created (like a new idea, or user, etc.), the response will use the "201 Created" status. Any other successful operation (like a successful query, delete, or update) will return a 200 status code. If a request fails, a non-200 status code will be returned, possibly with error information in XML format as the response's content. For instance, if a requested record could not be found, the HTTP response might look something like:
Example Response
<?xml version="1.0" encoding="UTF-8"?> <message client="" time="1315858057"><response><code>405</code><errors><error>The used HTTP request method "PUT" is not allowed for the action "execute".</error></errors></response></message>

5. Format

In addition to sending and receiving data as XML, FeedbackRoad also supports the JSON format. To use the JSON format instead of XML change the URL you post to from .xml to .json and the content and accept types from application/xml to application/json. Please note that all other examples shown in the documentation are based on the xml format for consistancy.
Example CURL
curl -H 'Accept: application/json' -H 'Content-Type: application/json' \ -u 123638dc733ceaf75130303fe6e6010f63868bc0:X -X POST -d '{"user":{"user_type":"user","user_display_name":"test user","user_email":"user@yahoo.com"}}' http://yoururl.feedbackroad.com/users.json

Example Response
{"code":200,"data": {
    "user_display_name":"barney rubble",
    "user_cdate":"2011-08-08 20:00:38",
    "user_mdate":"0000-00-00 00:00:00"}

collecting customer feedback
Collecting your customers feedback just became a lot easier
Feedback Collection more...

© 2011 www.FeedbackRoad.com
All Rights Reserved