Elegoo-Obico Chats API
The APIs documented on this page are designed for Elegoo partners to manage chat sessions with Obico's AI-powered chat assistant for 3D printing slicer guidance. This API allows you to create new chat sessions and retrieve existing chat sessions.
Authentication
Authentication is performed using user credentials passed as request parameters:
elegoo_user_id: The Elegoo user identifier registered in the systemaccess_token: The access token associated with the user
These credentials can be included either in the POST request body (JSON), GET request query parameters, or as query parameters for POST requests.
Use the Elegoo-Obico User Access Token API to manage user credentials before using the chats API.
Language Support
API responses can be returned in different languages using the lang query parameter. See the Elegoo-Obico Language Support documentation for details on supported languages and usage.
Example:
GET /ent/partners/api/elegoo/chats/?lang=zh-CN
Endpoint
https://elegoo-app.obico.io/. Production endpoint. Please use this endpoint unless instructed by the Obico team differently.https://elegoo-app-stg.obico.io/. Staging endpoint. Please don't use unless instructed by the Obico team.https://elegoo-cn-app.elegoo.com.cn. Production endpoint within China.https://elegoo-cn-app-stg.elegoo.com.cn. Staging endpoint within China.
GET /ent/partners/api/elegoo/chats/
Retrieves a list of all chat sessions for the authenticated user, ordered by most recent first.
Request
Query parameters
elegoo_user_id: The Elegoo user identifier. Required for authentication.access_token: The access token for the user. Required for authentication.
Example request
GET /ent/partners/api/elegoo/chats/?elegoo_user_id=ELEGOO_USER_001&access_token=your_access_token_here
Response
Status code: 200
API request was processed successfully.
Body
[
{
"id": 1,
"messages": "[{\"role\":\"user\",\"content\":\"What settings should I use?\"},{\"role\":\"assistant\",\"content\":\"I can help you with that...\"}]",
"machine_name": "Elegoo Neptune 4",
"filament_name": "PLA Generic",
"print_process_name": "0.20mm Standard",
"slicing_settings_json": "{\"temperature\":[\"220\"]}",
"user_feedback": null,
"user_feedback_text": null,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:35:00Z"
},
{
"id": 2,
"messages": "[{\"role\":\"user\",\"content\":\"How do I fix layer shifting?\"}]",
"machine_name": null,
"filament_name": null,
"print_process_name": null,
"slicing_settings_json": null,
"user_feedback": "positive",
"user_feedback_text": "Very helpful!",
"created_at": "2024-01-14T14:20:00Z",
"updated_at": "2024-01-14T14:25:00Z"
}
]
- Array of chat objects, each containing:
id: Integer. Unique identifier for the chat session.messages: String. JSON-encoded array of chat messages representing the conversation history.machine_name: String. Optional. Name of the printer/machine associated with this chat.filament_name: String. Optional. Name of the filament preset associated with this chat.print_process_name: String. Optional. Name of the print process preset associated with this chat.slicing_settings_json: String. Optional. JSON-encoded object containing slicing configuration information.user_feedback: String. Optional. User feedback value (e.g., "positive", "negative"). Maximum length 16 characters.user_feedback_text: String. Optional. Additional text feedback from the user.created_at: String. ISO 8601 timestamp indicating when the chat was created.updated_at: String. ISO 8601 timestamp indicating when the chat was last updated.
Status code: 401
Authentication failed. This can occur when:
- Missing
elegoo_user_idoraccess_token - Invalid credentials or expired access token
Body
{
"error": "elegoo_user_id and access_token are required"
}
or
{
"error": "Invalid or expired access token"
}
Note: Expired access tokens will return the "Invalid or expired access token" error message.
POST /ent/partners/api/elegoo/chats/
Creates a new chat session for the authenticated user.