Introduction
Welcome to ChatDOC API, Version 0.2.0!
ChatDOC is a powerful SaaS AI product that enables you to engage with documents, instantly retrieving answers along with cited sources. Our API provides developers with the tools to interact with the ChatDOC system, allowing you to create immersive experiences for your users.
This reference serves as a comprehensive guide to the ChatDOC system and its Version 0.2.0 API. Here, you'll find detailed information on the objects and endpoints used in the API. We greatly value your feedback. If you notice any missing or inaccurate information, please don't hesitate to open an issue on GitHub or submit a pull request to help improve our documentation.
To leverage ChatDOC's API capabilities, you'll need an API key. API keys can be created by subscribing to an appropriate membership plan or purchasing an API package on ChatDOC.com.
Conventions
All API requests should be directed to the domain api.chatdoc.com
. and secure HTTPS is mandatory for all interactions.
Our ChatDOC API adheres to RESTful conventions where applicable, utilizing standard HTTP methods such as GET, POST, PUT, and DELETE. Request and response payloads are encoded in JSON format.
HTTP status codes are used in accordance with industry standards. Successful requests return a 200 OK response, while failed requests produce 4xx or 5xx error codes.
Please note that this documentation pertains to ChatDOC API Version 0.2.0, which is not backward compatible with Version 0.1.0. While Version 0.1.0 remains functional, we strongly encourage users to migrate to Version 0.2.0 for the best experience.
If you have any questions or need further assistance, please don't hesitate to reach out to our support team.
This revised introduction reflects the transition to ChatDOC API Version 0.2.0 and highlights its features and benefits.
JSON conventions
-
Response body of success requests is generally as follows:
{ "status": "ok", "data": { "id": 160, "name": "Bo", ... } }
status
anddata
are common properties.- Object properties are contained directly in
data
, there is no extra model objects. (e.g. "document", "user", etc.)
-
And failed response may be:
400 Bad Request
{ "detail": "Error message" }
detail
is the error message.status
is not returned.
404 Not Found
{ "data": {}, "detail": "This page has expired, please refresh the page and try again." }
detail
of404
is unified as above message, no matter which kind of resources you get.
-
Property names are in snake_case (not camelCase or kebab-case).
-
Time is stored as Unix timestamps in seconds, and this point in time technically does not change no matter where you are located on the globe. You can convert it to datetime of your local timezone.
-
Optional properties are nullable, you can just ignore it sometimes.
Request limits
To ensure a consistent developer experience for all API users, the ChatDOC API is rate limited.