openapi: 3.2.0 info: title: Kelowna Production myCC - Assets API version: v1 tags: - name: myCC - Assets paths: /Assets: get: tags: - myCC - Assets summary: Gets the assets that the customer is allowed to see parameters: - name: accountId in: query description: The ID of the user's myCC account schema: type: integer format: int32 - name: assetId in: query description: Specify the assetID to return a single asset with the matching ID. schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/MyCCAsset' application/json: schema: type: array items: $ref: '#/components/schemas/MyCCAsset' text/json: schema: type: array items: $ref: '#/components/schemas/MyCCAsset' security: - {} - MyCCAuth: - applicationId - roles - {} operationId: getAssets x-operation-id-source: derived /Assets/{assetId}: delete: tags: - myCC - Assets summary: Deletes an asset parameters: - name: assetId in: path description: The ID of the asset to delete required: true schema: type: integer format: int32 - name: deleteFromS3 in: query description: "If true, deletes the asset from S3 in addition to the DB record.\n False by default." schema: type: boolean default: false responses: '200': description: OK security: - {} - MyCCAuth: - applicationId - roles - {} operationId: deleteAssetsByAssetId x-operation-id-source: derived put: tags: - myCC - Assets summary: Updates an asset record. description: 'If there are no changes to the file itself, the `File` arg can be left null to avoid overwriting the existing upload in S3.' parameters: - name: assetId in: path description: The ID of the asset to update required: true schema: type: integer format: int32 - name: Name in: query schema: type: string - name: FileExtension in: query schema: type: string - name: Description in: query schema: type: string - name: Link in: query description: 'URL pointing to location of the asset. Only required if asset is an external link.' schema: type: string - name: Path in: query description: 'Asset path displayed in the UI. Not required for Folder or Icon AssetTypes' schema: type: string - name: MyCCAccountId in: query description: 'ID of MyCC account associated with the asset. Should be null if asset is "shared" or associated with a staff user.' schema: type: integer format: int32 - name: StaffUserId in: query description: Only Icon asset types can be associated with StaffUsers. schema: type: integer format: int32 - name: AssetType in: query schema: $ref: '#/components/schemas/AssetType' - name: IsKeyResource in: query schema: type: boolean - name: ThumbnailLink in: query description: 'Deprecated. Public URL pointing asset location. Use `GET Assets/AssetUrl/{assetId}?isThumbnail=true` to get a pre-signed URL providing access to the asset thumbnail. Use `POST Assets/Thumbnail/{assetId}` to upload a new thumbnail for an asset.' schema: type: string - name: LastUpdatedTimestamp in: query schema: type: string format: date-time requestBody: content: multipart/form-data: schema: type: object properties: File: type: string format: binary encoding: File: style: form responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/MyCCAsset' application/json: schema: $ref: '#/components/schemas/MyCCAsset' text/json: schema: $ref: '#/components/schemas/MyCCAsset' security: - {} - MyCCAuth: - applicationId - roles - {} operationId: putAssetsByAssetId x-operation-id-source: derived /Assets/AddAsset: post: tags: - myCC - Assets summary: Adds a new asset record and uploads the attached file to S3 parameters: - name: Name in: query schema: type: string - name: FileExtension in: query schema: type: string - name: Description in: query schema: type: string - name: Link in: query description: 'URL pointing to location of the asset. Only required if asset is an external link.' schema: type: string - name: Path in: query description: 'Asset path displayed in the UI. Not required for Folder or Icon AssetTypes' schema: type: string - name: MyCCAccountId in: query description: 'ID of MyCC account associated with the asset. Should be null if asset is "shared" or associated with a staff user.' schema: type: integer format: int32 - name: StaffUserId in: query description: Only Icon asset types can be associated with StaffUsers. schema: type: integer format: int32 - name: AssetType in: query schema: $ref: '#/components/schemas/AssetType' - name: IsKeyResource in: query schema: type: boolean - name: ThumbnailLink in: query description: 'Deprecated. Public URL pointing asset location. Use `GET Assets/AssetUrl/{assetId}?isThumbnail=true` to get a pre-signed URL providing access to the asset thumbnail. Use `POST Assets/Thumbnail/{assetId}` to upload a new thumbnail for an asset.' schema: type: string - name: LastUpdatedTimestamp in: query schema: type: string format: date-time requestBody: content: multipart/form-data: schema: type: object properties: File: type: string format: binary encoding: File: style: form responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/MyCCAsset' application/json: schema: $ref: '#/components/schemas/MyCCAsset' text/json: schema: $ref: '#/components/schemas/MyCCAsset' security: - {} - MyCCAuth: - applicationId - roles - {} operationId: postAssetsAddAsset x-operation-id-source: derived /Assets/Thumbnail/{assetId}: post: tags: - myCC - Assets summary: Uploads a thumbnail for an asset to S3 description: The corresponding asset must already exist in the DB in order to upload a thumbnail for it. parameters: - name: assetId in: path description: ID of existing asset for which thumbnail is being uploaded. required: true schema: type: integer format: int32 requestBody: content: multipart/form-data: schema: required: - file type: object properties: file: type: string description: File to be used as the asset thumbnail. format: binary encoding: file: style: form responses: '200': description: OK security: - {} - MyCCAuth: - applicationId - roles - {} operationId: postAssetsThumbnailByAssetId x-operation-id-source: derived /Assets/Url/{assetId}: get: tags: - myCC - Assets summary: Returns a URL pointing to the asset. parameters: - name: assetId in: path description: ID of asset to fetch URL for. required: true schema: type: integer format: int32 - name: isThumbnail in: query description: Boolean indicating whether a link to an asset or it's thumbnail is required. False by default. schema: type: boolean default: false responses: '200': description: OK content: text/plain: schema: type: string application/json: schema: type: string text/json: schema: type: string security: - {} - MyCCAuth: - applicationId - roles - {} operationId: getAssetsUrlByAssetId x-operation-id-source: derived /Assets/Zip: get: tags: - myCC - Assets summary: Generates a zip file with multiple assets enclosed parameters: - name: assetIds in: query description: IDs of assets to be included in zip file. schema: type: array items: type: integer format: int32 responses: '200': description: OK security: - {} - MyCCAuth: - applicationId - roles - {} operationId: getAssetsZip x-operation-id-source: derived components: schemas: AssetType: enum: - File - Folder - ExternalLink - Icon type: string MyCCAsset: required: - name type: object properties: name: minLength: 1 type: string fileExtension: type: - string - 'null' sizeBytes: type: - number - 'null' format: double myCCAssetId: type: integer format: int32 mongoId: type: - string - 'null' path: type: - string - 'null' assetType: $ref: '#/components/schemas/AssetType' description: type: - string - 'null' link: type: - string - 'null' lastUpdatedTimestamp: type: - string - 'null' format: date-time thumbnailLink: type: - string - 'null' isKeyResource: type: - boolean - 'null' thumbnailS3BucketPath: type: - string - 'null' hasThumbnail: type: boolean readOnly: true myCCAccountId: type: - integer - 'null' format: int32 myCCAccountName: type: - string - 'null' readOnly: true isHidden: type: boolean additionalProperties: false securitySchemes: OrcaAuth: type: oauth2 flows: authorizationCode: authorizationUrl: https://auth.carboncure.com/oauth2/authorize tokenUrl: https://auth.carboncure.com/oauth2/token scopes: {} MyCCAuth: type: oauth2 flows: authorizationCode: authorizationUrl: https://auth.carboncure.com/oauth2/authorize tokenUrl: https://auth.carboncure.com/oauth2/token scopes: {} M2MAuth: type: oauth2 flows: authorizationCode: authorizationUrl: https://auth.carboncure.com/oauth2/authorize tokenUrl: https://auth.carboncure.com/oauth2/token scopes: {}