openapi: 3.0.0
info:
  version: 1.0.0
  title: Aura™ 3D Model API
  contact:
    email: andreas.zeitler@vuframe.com
    name: Andreas Zeitler
  description: >-
    The model API allows you to upload, download, process and convert CAD / 3D
    files with Vuframe's Aura™ service.
  termsOfService: 'https://www.vuframe.com/terms-of-service/'
tags:
  - name: admins
    description: Secured Admin-only calls
paths:
  /resources/{id}:
    get:
      tags:
        - admins
        - resource
      summary: retrieve details of a specific resource by ID
      operationId: getResourceDetails
      description: |
        This request allows you to get resource details with model details and original resource details, if they exist.
      parameters: 
        - in: path
          name: id
          description: database id of the resource
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Resource Details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResourceResponse'
  /models/{token}:
    get:
      tags:
        - admins
      summary: retrieve the details for a specific model
      operationId: getModelDetails
      description: |
        By passing in the appropriate options, you can search for
        available inventory in the system
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Model Details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelResponse'
        '400':
          description: bad input parameter
    put:
      tags:
        - admins
      summary: puts the settings or hotspots for a specific model
      operationId: putModelDetails
      description: |
        By passing in the appropriate options, you can search for
        available inventory in the system
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      requestBody:
        description: ""
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                settings:
                  type: object
                  $ref: '#/components/schemas/EditableSettingsObject'
                hotspots:
                  type: array
                  items:
                    $ref: '#/components/schemas/HotspotObject'
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ModelObject'
        '400':
          description: bad input parameter
  /models/{token}/files:
    get:
      tags:
        - admins
      summary: retrieve the details for a specific model
      operationId: getModelFiles
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                type: object
  /models/{token}/formats:
    get:
      tags:
        - admins
      summary: retrieve the details for a specific model
      operationId: getModelFormats
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                type: object
  /models/{token}/status:
    get:
      tags:
        - admins
      summary: retrieve the details for a specific model
      operationId: getModelStatus
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                type: object
  /models/{token}/issues:
    get:
      tags:
        - admins
      summary: retrieve the details for a specific model
      operationId: getModelIssues
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                type: object
  /models/{token}/resources:
    get:
      tags:
        - admins
      summary: retrieve the details for a specific model
      operationId: getModelResources
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                type: object
  /models/{token}/tasks:
    get:
      tags:
        - admins
      summary: retrieve the tasks for a specific model
      operationId: getModelTasks
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                type: object
  /models/{token}/reprocess:
    post:
      tags:
        - admins
      summary: reprocess a specific model
      operationId: reprocessModel
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      requestBody:
        description: "Optional body with filter options like file_type."
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                file_type:
                  type: string
                  description: "File Type of Model (e.g. aura3d_files) described here: `https://share.vuframe.com/1759d56c`"
                  example: "aura3d_files"
      responses:
        '200':
          description: list of items that will be reprocessed.
          content:
            application/json:
              schema:
                type: object
  /models/{token}/operations:
    get:
      tags:
        - admins
      summary: retrieve the details for a specific model
      operationId: getModelOperations
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                type: object
  /models/{token}/operations/{operation}:
    patch:
      tags:
        - admins
      summary: retrieve the details for a specific model
      operationId: performModelOperation
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
        - in: path
          name: operation
          description: the operation's id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                type: object
  /models/{token}/upload/{relative_path}:
    patch:
      tags:
        - admins
      summary: retrieve the details for a specific model
      operationId: uploadModelFile
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
        - in: path
          name: relative_path
          description: the relative path of the uploaded file
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                type: object
  /models/{token}/hotspots:
    get:
      tags:
        - hotspots
      summary: ⚠️ not implemented - get all hotspots of a specific model
      operationId: getHotspots
      parameters: 
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Response of Success
          content:
            application/json:
                schema:
                  type: array
                  items:
                    $ref: '#/components/schemas/HotspotObject'
          
    post:
      tags:
        - hotspots
      summary: ⚠️ not implemented - create, update and remove one or many hotspots
      operationId: postHotspots
      parameters:
        - in: path
          name: token
          description: the token identifying the model
          required: true
          schema:
            type: string
      requestBody:
        description: ""
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/HotspotObject'
      responses:
        '200':
          description: Response for Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    default: true
                    description: "Was the Request successfully processed?"
        '404':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: "Error Message"
                
                
  /workspaces/{token}/models:
    get:
      tags:
        - workspace
      summary: retrieve all models of a workspace
      operationId: getModelsOfWorkspace
      parameters:
        - in: path
          name: token
          description: the token identifying the workspace
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModelObject'
  /workspaces/{token}/reprocess:
    post:
      tags:
        - workspace
      summary: reprocess every model of a workspace
      operationId: reprocessWorkspace
      parameters:
        - in: path
          name: token
          description: the token identifying the workspace
          required: true
          schema:
            type: string
      requestBody:
        description: "Optional body with filter options like file_type."
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                file_type:
                  type: string
                  description: "File Type of Model (e.g. aura3d_files) described here: `https://share.vuframe.com/1759d56c`"
                  example: "aura3d_files"
      responses:
        '200':
          description: list of items that will be reprocessed.
          content:
            application/json:
              schema:
                type: object
externalDocs:
  description: Vuframe® Docs
  url: 'https://vuframe.com/docs/'
servers:
  - url: 'https://api.vuframe.com/v3/aura'
components:
  schemas:
  
    ResourceResponse:
      type: object
      properties:
        resource:
          type: object
          properties:
            id:
              type: string
              description: ID of resource
            type:
              type: string
              description: type of resource
              example: Cms2::Any3dFileResource
            source_url:
              type: string
              description: S3 presigned download url for original resource
            source_filesize:
              type: integer
              description: filesize in bits
              example: 503639292
            assets_url:
              type: string
              description: S3 presigned download url for assets.zip
        item:
          type: object
          properties:
            title:
              type: string
              description: title of model
            project:
              type: string
              description: title of project / space
            token:
              type: string
              description: token of model
            live_content:
              type: boolean
              description: is this item part of a shared SmartVu®?
            version:
              type: integer
              description: version number
            file_type:
              type: string
              description: content type of latest resource
              example: any_3d.unity
            uploaded_file_type:
              type: string
              description: content type of original resource
              example: any_3d.unity
            resource:
              type: object
              properties:
                id:
                  type: integer
                  description: ID of resource
                key: 
                  type: string
                  description: S3 storage key of resource
                  example: resources/39532/
                type: 
                  type: string
                  description: content type of resource
                  example: any_3d.unity
            original:
              type: object
              properties:
                id:
                  type: integer
                  description: ID of original resource
                key: 
                  type: string
                  description: S3 storage key of original resource
                  example: resources/39532/
                type: 
                  type: string
                  description: content type of original resource
                  example: any_3d.unity
        
    ModelResponse:
      allOf:
        - $ref: '#/components/schemas/ModelDetailsObject'
        - type: object
          properties:
            settings:
              type: object
              $ref: '#/components/schemas/SettingsObject'
            hotspots:
              type: array
              items:
                $ref: '#/components/schemas/HotspotObject'
    ModelObject:
      type: object
      properties:
        platform_version:
          type: number
          example: 1
        token:
          type: string
        title:
          type: string
          example: 'A title'
        title_translations:
          type: object
        description:
          type: string
          example: 'A description'
        description_translations:
          type: object
        hashtags:
          type: string
        hashtags_translations:
          type: object
        item_type:
          type: string
          example: 'any3d_scene'
        version:
          type: number
        file_size:
          type: number
        updated_at:
          type: string
        inclusion:
          type: string
        folder_token:
          type: string
        file_extension:
          type: string
        package_resolutions:
          type: string
        preview_image_url:
          type: string
        preview_image_mime_type:
          type: string
        thumbnail_image_url:
          type: string
        content_url:
          type: string
        content_mime_type:
          type: string
        properties_url:
          type: string
        named_resources_url:
          type: string
        properties:
          type: object
        project:
          type: string
        company:
          type: string
    VectorObject:
      type: object
      properties:
        x: 
          type: number
          description: X float
        y: 
          type: number
          description: Y float
        z: 
          type: number
          description: Z float
    HotspotProperties:
      type: object
      description: Properties are used to create or update hotspots. Requests return an **HotspotObject**, which contains all properties of a hotspot, including read-only ones.
      properties:
        name: 
          type: string
          description: the name of the hotspot object, this is used to access it using Actions
        title: 
          type: string
          description: human-readable title
        description: 
          type: string
          description: human-readable description
        removed: 
          type: boolean
          description: if true this hotspot will not be displayed
        removed_by: 
          type: string
          enum: 
            - from_resource
            - in_editor
          description: "indicates where and why this hotspot was removed.
            
            \n*by_model_revision*: the hotspot was not included in a newer model revision, that was uploaded. This only applies for hotspots generated from the original CAD/3D file.
            \n\n*in_editor*: the hotspot was removed in the editor, this applies for hotspots generated from the original CAD/3D file which are then removed by the user in the online editor."
            
        position:
          $ref: '#/components/schemas/VectorObject'
        rotation:
          $ref: '#/components/schemas/VectorObject'
        is_billboard:
          type: boolean
          default: false
          description: "Has billboarding activated? This will overwrite rotation if set to true."
        type: 
          type: string
          description: 'the type of the hotspot'
          enum:
            - event
            - ego
        texture: 
          type: object
          description: 'Image Item'
          properties:
            token:
              type: string
              description: Token of Item
            url:
              type: string
              description: Presigned S3 URL
        color: 
          type: string
          default: (0,255,0,1)
          description: 'color of the hotspot. r,g.b,a with rgb between 0 and 255 and a between 0 and 1'
        scale: 
          type: number
          default: 1.0
          description: float between 0.1 to 5.0
    HotspotObject:
      type: object
      description: the full hotspot object contained in a model. This is merged with **HotspotProperties**
      properties:
        id:
          type: string
          description: unique ID of this hotspot, automatically generated
        path: 
          type: string
          description: the path of the hotspot /foo/bar/name 
        source: 
          type: string
          description: where did this hotspot come from? Was it contained in the originally uploaded model (Unity 3D exports only) or generated during processing (based on naming conventions) or created in the editor.
          enum:
            - UPLOAD
            - GENERATED
            - EDITOR
            - UNKNOWN
        source_resource_version: 
          type: number
          description: <die versionsnummer der resource mit dem der hotspot initial im modell hinzugefügt wurde>
        changed_in_editor: 
          type: boolean
          description: returns true if this hotspot was changed from the original definition contained in the uploaded model.
        properties:
          type: object
          description: the editable properties of this hotspot
          $ref: '#/components/schemas/HotspotProperties'
    ModelDetailsObject:
      type: object
      description: Details of a Model
      properties:
        id: 
          type: number
          description: ID of Model
        title: 
          type: string
          description: Title of Model
        project:
          type: string
          description: Title of Project containing Model
        token:
          type: string
          description: Token of Model
        studio_url:
          type: string
          description: Studio URL to Model
        download_url:
          type: string
          description: unsigned CDN URL to Model
        live_content:
          type: boolean
          description: Is live content?
        version:
          type: number
          description: Latest Version Number
        file_type:
          type: string
          description: Type of File Resource
        file_size:
          type: number
          description: Storage Usage of Model
        uploaded_file_type:
          type: string
          description: Type of Original File Resource
        resource: 
          type: object
          description: Latest Resource
          properties:
            id:
              type: number
              description: ID of Resource
            key: 
              type: string
              description: S3 Storage Path
            type:
              type: string
              description: Type of Resource
        original:
          type: object
          description: 'Optional: Original Resource'
          properties:
            id:
              type: number
              description: ID of Resource
            key: 
              type: string
              description: S3 Storage Path
            type:
              type: string
              description: Type of Resource
    AmbientOcclusionObject:
        type: object
        properties:
          enabled:
            type: boolean
            description: Has Ambient Occlusion enabled?
          radius:
            type: number
            description: Radius of Ambient Occlusion in float
          intensity:
            type: number
            description: Intensity of Ambient Occlusion in float
    EditableSettingsObject:
        type: object
        properties:
          scale:
            type: number
            description: Scale of 3D Model in float
          rotate_x:
            type: number
            description: X value of rotation in float
          rotate_y:
            type: number
            description: Y value of rotation in float
          rotate_z:
            type: number
            description: Z value of rotation in float
          positioning_x:  
            type: string 
            description: X value of positioning ("MIN|CENTER|MAX")
          positioning_y:  
            type: string 
            description: X value of positioning ("MIN|CENTER|MAX")
          positioning_z:  
            type: string 
            description: X value of positioning ("MIN|CENTER|MAX")
          offset_x:
            type: number 
            description: X value of offset in meter (Unity standard)
          offset_y:  
            type: number 
            description: X value of offset in meter (Unity standard)
          offset_z:  
            type: number 
            description: X value of offset in meter (Unity standard)
          flip_x: 
            type: boolean
            description: Should flip 3D model on X axis? 
          flip_y: 
            type: boolean
            description: Should flip 3D model on Y axis?           
          flip_z: 
            type: boolean
            description: Should flip 3D model on Z axis? 
          limit_uv_coordinates_for_seam: 
            type: boolean
            description: Limits the v-value for UV coordinates to 0.99 or lower for all objects whose name starts with the word "Seam". This is a customer-specific fix for Olymp.
          environment_asset:
            type: object
            properties:
              token:
                type: string
              uri:
                type: string
                description: URI with AWS URI or file uri
          addon_assets:
            type: array
            items:
              type: object
              properties:
                token: 
                  type: string
                uri:
                  type: string
                  description: URI with AWS URI or file uri
          ambient_occlusion:
            $ref: '#/components/schemas/AmbientOcclusionObject'
          ground_shadow: 
            type: boolean
            default: false
            description: "Should ground shadows get created?"
    SettingsObject:
      allOf:
        - type: object
          properties:
            api_version: 
              type: number
              description: API version
            studio_owner_token: 
              type: string
              description: Studio Owner Token
            main_file_name:
              type: string
              description: Name of the main file. This option is needed to set the main file that includes other files within. We need this behavior for uploads of zip Archives (e.g. CATIA, Solidworks)
        - $ref: '#/components/schemas/EditableSettingsObject'
  securitySchemes:
    basic:
      type: http
      scheme: basic
security: 
  - basic: []