Getting Started

This page will help you get started with Tutu Api. You'll be up and running in a jiffy!

📝 Overview

The Tutu API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application. JSON is returned by all API responses, including errors.

Tutu API is completely free to use. You can use it to build your own applications, or to integrate with Tutu. Or because it's open-source, you can even self-host the project. If you want to self-host Tutu, you can go to this Self-Host Tutu


🛠️Methods

The TUTU v1 API uses standard HTTP verbs to indicate the desired action to be performed on the resource. The following table lists the HTTP methods that are supported by the API.

MethodAction
GETRetrieve a resource or a list of resources.
POSTCreate a new resource.
PUTUpdate a resource including partial updates.
DELETEDelete a resource.

Disclaimer, There's Method which act a little bit different, Mostly POST method that act like PUT method. We made this decision to met the requirement from product owner. We felt ashamed for this decision, but we had to do it. So that our final score in our final project doesn't get affected by it. We hope you understand. 🙂


🚦 Status Code

The Tutu API uses conventional HTTP response codes to indicate the error. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with Tutu's servers (these are rare).

⚠️ Errros

Status CodeDescription
400Bad Request - The request was unacceptable, often due to invalid values.
401Unauthorized - No valid bearer token provided.
404Not Found - The requested resource doesn't exist.
422Unprocessable Entity - The request was unacceptable, often due to missing parameters or fields.

In the case of 400, 401, and 404, the response body will contain an error object with a message field. For example:

{
  "message": "The error message",
}

In the case of 422. The response body will contain a list of errors, each with a location of parameter or fields that caused the error, a message describing the error and a type of error. For example:

{
  "message": [
    {
      "loc": [ <- Error location
        "body",
        "title" <- which field that occurred the error ('body.title')
      ],
      "msg": "field required", <- Error message
      "type": "value_error.missing" <- Error Type
    },
  ]
}
  • Using postman?, you can use this button to import the collection

Run in Postman

  • See our database diagram you can click here
  • To use image classification, you can use make download_model or download it manually from this and place it in backend/app/image_classification/pipeline/model.pth

Thanks for reading this far, we hope you enjoy our API. ❤️