API Documentation

Choose a section from the menu at the right

API Documentation

API Endpoint

http://api.triponadeal.com/v1

Resources

Our API exposed the following primary resources which are accessible directly from the root of the object hierarchy:

  • /deals – Provides access to the deals.
  • /episodes – Provides access to the episodes.
  • /users – Access to users.

Additional Resources

The following endpoints represent special resources that can be used to query the current user.

  • /me – the logged in user.

Parameters

request_id

You can use this parameter to pass an identifier (some string) which will be returned with the result.

count

Allows you to specify the maximum number of result objects when querying a collection. This parameter is always optional and defaults to 30. It cannot exceed 100.

offset

The complement to the count parameter. It indicates how many elements should be skipped when returning a collection. This parameter is always optional and defaults to 0.

callback

The callback parameter, when present, triggers a JSONP response and wraps the resulting JSON object in a method call named after the value of callback. Callback, when present, must not be null and must adhere to javascript method naming conventions. This parameter is always optional.

Single object result format

When querying for a single object the object itself is returned as the top level json object. An api_status object is injected that contains the request_id as a string.

Collection result format

When querying for a collection the top level json object contains a property collection which is an array of objects. An api_status object is injected that contains the request_id as a string. The complete list of parameters:

  • collection
    An array containing zero or more result objects.
  • total_count
    The total number of items available.
  • offset
    The zero offset within the result set where the results have been taken from.
  • count
    The request count of items to be returned. To check the actual number of returned results test for the length of collection.
  • api_status
    The status object containing the request_id.

Error result format

Returned in case an error occurred. Must be used in conjunction with the status code.

  • errors
    Collection of error objects. An error object consists of an optional attr property and a message object detailing the error. If attr is set, then the message applies to a specific field, otherwise it applies to the whole request.

api_status object

This object contains information regarding the api status. Currently it passes your optional request id along.

  • request_id
    String containing the optional request_id passed with the request.

Status Codes

We support the following status codes which need to be checked for when processing results:

  • 200 – OK
    The request has been processed successfully.
  • 201 – CREATED
    A new resource has been created. Typically the newly created resource is also returned within the result body.
  • 400 – BAD REQUEST
    The request was received but it was not understood. This is likely a result of a missing or invalid parameter, especially when a POST method is invoked.
  • 401 – NOT AUTHORIZED
    The currently logged in user (as defined through the access_token) is not authorized to access this resource.
  • 404 – NOT FOUND
    The specified resource could not be found.

All other status codes, if they occur, should be treated as internal server errors and the request should be submitted again after waiting for at least one second. Use exponential back off and don't hammer the API.