API_README.md 5.5 KB

Canvas Creation Module API

This repository contains the server-side code for the Canvas Creation Module API. The API provides endpoints for submitting and managing 3D and AI image tasks, as well as retrieving their statuses and previews.

Table of Contents

Installation

Endpoints

Submit 3D Image Task

  • URL: /creation-module/3d-image/submit
  • Method: POST
  • Description: Submits a new 3D image task.
  • Request Body:

    {
        "user_id": "string",
        "project_id": "string",
        "scene_data": "object"
    }
    
  • Response:

    {
        "status": "success",
        "data": {
            "message": "Task successfully submitted",
            "job_id": "string"
        }
    }
    

Submit AI Image Task

  • URL: /creation-module/ai-image/submit
  • Method: POST
  • Description: Submits a new AI image task.
  • Request Body:

    {
        "user_id": "string",
        "project_id": "string",
        "rendered_image_id": "string",
        "ai_scene_data": "object"
    }
    
  • Response:

    {
        "status": "success",
        "data": {
            "message": "Task successfully submitted",
            "job_id": "string"
        }
    }
    

Update 3D Image Task Status

  • URL: /creation-module/3d-image/update-status
  • Method: POST
  • Description: Updates the status of a 3D image task.
  • Request Body:

    {
        "row_id": "string",
        "new_status": "integer"
    }
    
  • Response:

    {
        "status": "success",
        "data": {
            "row": "string",
            "status": "integer"
        }
    }
    

Update AI Image Task Status

  • URL: /creation-module/ai-image/update-status
  • Method: POST
  • Description: Updates the status of an AI image task.
  • Request Body:

    {
        "row_id": "string",
        "new_status": "integer"
    }
    
  • Response:

    {
        "status": "success",
        "data": {
            "row": "string",
            "status": "integer"
        }
    }
    

Get Latest 3D Image Status

  • URL: /creation-module/3d-image/status/:project_id
  • Method: GET
  • Description: Retrieves the latest status of a 3D image task for a given project ID.
  • Response:

    {
        "status": "success",
        "data": {
            "status": "integer"
        }
    }
    

Get Latest AI Image Status

  • URL: /creation-module/ai-image/status/:project_id
  • Method: GET
  • Description: Retrieves the latest status of an AI image task for a given project ID.
  • Response:

    {
        "status": "success",
        "data": {
            "status": "integer"
        }
    }
    

Upload 3D Image Preview

  • URL: /creation-module/3d-image/upload-preview
  • Method: POST
  • Description: Uploads a preview image for a 3D image task.
  • Request Body:

    {
        "row_id": "string",
        "image_base64": "string"
    }
    
  • Response:

    {
        "status": "success",
        "message": "Preview uploaded successfully"
    }
    

Upload AI Image Preview

  • URL: /creation-module/ai-image/upload-preview
  • Method: POST
  • Description: Uploads a preview image for an AI image task.
  • Request Body:

    {
        "row_id": "string",
        "image_base64": "string"
    }
    
  • Response:

    {
        "status": "success",
        "message": "Preview uploaded successfully"
    }
    

Get Latest 3D Image Task Preview

  • URL: /creation-module/3d-image/preview/:project_id
  • Method: GET
  • Description: Retrieves the latest preview image for a 3D image task for a given project ID.
  • Response:

    {
        "status": "success",
        "data": "string"
    }
    

Get Latest AI Image Task Preview

  • URL: /creation-module/ai-image/preview/:project_id
  • Method: GET
  • Description: Retrieves the latest preview image for an AI image task for a given project ID.
  • Response:

    {
        "status": "success",
        "data": "string"
    }
    

Get 3D Image Task by ID

  • URL: /creation-module/3d-image/:row_id
  • Method: GET
  • Description: Retrieves a 3D image task by its row ID.
  • Response:

    {
        "status": "success",
        "data": "object"
    }
    

Get AI Image Task by ID

  • URL: /creation-module/ai-image/:row_id
  • Method: GET
  • Description: Retrieves an AI image task by its row ID.
  • Response:

    {
        "status": "success",
        "data": "object"
    }
    

License

This project is licensed under the MIT License.