Skip to content

Instantly share code, notes, and snippets.

@amackera
Last active August 29, 2015 13:56
Show Gist options
  • Save amackera/9103727 to your computer and use it in GitHub Desktop.
Save amackera/9103727 to your computer and use it in GitHub Desktop.
Top Hat Feedback API Documentation

Top Hat Feedback API Documentation

Here's some documentation explaining our user-accessible Feedback API. All of the API routes should be prefixed with the root URL of Top Hat's web server, app.tophat.com.

This is not the complete API, but these methods should be all that you need to use the API in the way you require!

Feel free to shoot me an email directly if you have any questions: anson@tophat.com

All requests to Top Hat's API should have the API-KEY HTTP header set to your API key. You can determine your API key by logging into Top Hat and running window.ajax_headers['API-KEY'] inside a JavaScript console.

GET /api/v2/feedback/

Description

GETting this list resource will return a paginated list of Feedbacks that your user is authorized to see.


POST /api/v2/feedback/

Description

POSTing a new Feedback to this list route will create a new Feedback item.

Accepts:

body:
  title: String
  duration: Number
  course: URI referencing a course in Top Hat 

Returns

location header contains the resource URI of the newly created Feedback.

Authorization:

Only users authorized to create content in the course provided will be allowed to POST new Feedbacks. This usually means professors who created the course that the Feedback is being created for.


GET /api/v2/feedback/:id

GETting this detail resource will return all of the data for a specified Feedback.

Authorization:

Only teachers who own the course, or students enrolled in the course, can pull Feedback contained within the course.

Returns:

body:
  title: String
  sms_key: String
  duration: Number
  course: URI
  data: List
  seconds_until_active: Number

GET /api/v2/feedback_response/:id

Description

Feedback response data can be pulled from the API by accessing the /api/v2/feedback_response/:id route, and providing a Feedback ID for the :id parameter in the URI. Use this to get specific details about user responses to Feedbacks. Each user has a timeout that prevents them from re-submitting, so this resource returns user-specific data.

Returns

No data, just HTTP response.


PUT /api/v2/feedback_response/:id

Users submit new Feedback responses by PUTting to the /api/v2/feedback_response/:id resource, and providing a Feedback ID for the :id parameter in the URI. Use this to submit responses to Feedback items.

Returns

No data, just HTTP response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment