swagger: '2.0'
info:
  title: File Export Job Admin REST APIs
  version: '2.0'
paths:
  /file-export-jobs:
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: |
            The type of the file export process. The supported export types:
            * CustomerSegmentExport
            * PromotionCodeExport
          enum:
            - CustomerSegmentExport
            - PromotionCodeExport
          in: query
          name: type
          required: true
          type: string
        - default: IBM_Admin_Summary
          description: The access profile.
          in: query
          name: accessProfile
          required: false
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/FileExportJobCollection'
          x-entity-path: dataArea/fileUploadJob
      summary: Get all file export jobs for a specific export type.
      x-expression-template: '{_wcf.ap=''{accessProfile}''}/FileUploadJob[UploadType=''{type}'']'
      x-facade-client-class: com.ibm.commerce.content.facade.client.ContentFacadeClient
      x-facade-client-method: getFileUploadJob
      x-request-bod-class: com.ibm.commerce.content.facade.datatypes.GetFileUploadJobType
    post:
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: |
            The type of the file export process. The supported export types:
            * CustomerSegmentExport
            * PromotionCodeExport
          enum:
            - CustomerSegmentExport
            - PromotionCodeExport
          in: query
          name: type
          required: true
          type: string
        - description: >-
            If the type of the file export process is PromotionCodeExport, the
            unique ID is the promotion ID. If the type of the file export
            process is CustomerSegmentExport, the unique ID is the customer
            segment ID.
          format: int64
          in: query
          name: uniqueId
          required: true
          type: integer
        - default: exportFile
          description: The name of the exported file. The default is exportFile
          in: query
          name: exportFileName
          required: false
          type: string
      responses:
        '201':
          description: The operation is successful.
          headers:
            Location:
              description: The URI of the file export job.
              type: string
          x-entity-path: uploadFileId
      summary: Create a file export job for a specific type of file export.
      x-flow-class: com.ibm.commerce.rest.admin.v2.content.FileExportJobCommandFlow
  '/file-export-jobs/{id}':
    get:
      produces:
        - application/json
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: The unique numeric ID for identifying the file export job.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/fileUploadJob[1]/fileUploadJobIdentifier/uniqueID'
        - default: IBM_Admin_Details
          description: The access profile.
          in: query
          name: accessProfile
          required: false
          type: string
      responses:
        '200':
          description: The operation is successful.
          schema:
            $ref: '#/definitions/FileExportJob'
          x-entity-path: 'dataArea/fileUploadJob[1]'
      summary: Get a file export job details by ID.
      x-expression-template: >-
        {_wcf.ap={accessProfile}}/FileUploadJob[FileUploadJobIdentifier[UniqueID='{id}']]
      x-facade-client-class: com.ibm.commerce.content.facade.client.ContentFacadeClient
      x-facade-client-method: getFileUploadJob
      x-request-bod-class: com.ibm.commerce.content.facade.datatypes.GetFileUploadJobType
  '/file-export-jobs/{id}/data':
    delete:
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: The unique numeric ID for identifying the file export job.
          format: int64
          in: path
          name: id
          required: true
          type: integer
          x-entity-path: 'dataArea/fileUploadJob[1]/fileUploadJobIdentifier/uniqueID'
      responses:
        '204':
          description: The operation is successful.
      summary: Delete a file export job.
      x-action-code: Delete
      x-expression-template: '/FileUploadJob[1]'
      x-facade-client-class: com.ibm.commerce.content.facade.client.ContentFacadeClient
      x-facade-client-method: processFileUploadJob
      x-request-bod-class: com.ibm.commerce.content.facade.datatypes.ProcessFileUploadJobType
    get:
      produces:
        - text/plain
      parameters:
        - description: The unique numeric ID for identifying the store.
          format: int32
          in: query
          name: storeId
          required: true
          type: integer
          x-context-data: storeId
        - description: The unique numeric ID for identifying the file export job.
          format: int64
          in: path
          name: id
          required: true
          type: integer
      responses:
        '200':
          description: The operation is successful.
          schema:
            type: string
      summary: Get the data exported from a file export job.
      x-flow-class: com.ibm.commerce.rest.admin.v2.content.FileExportJobCommandFlow
definitions:
  FileExportJob:
    description: The details of file export job.
    properties:
      characterSet:
        default: UTF-8
        description: The encoding of the file to be uploaded. The default is UTF-8.
        type: string
        x-entity-path: uploadFile/fileInfo/fileEncoding
      dateTime:
        description: The date and time that the file was exported.
        format: date-time
        type: string
        x-entity-path: uploadFile/uploadTime
      fileName:
        description: The name of the exported file.
        type: string
        x-entity-path: uploadFile/fileInfo/fileName
      id:
        description: The unique numeric ID for identifying the file export job.
        format: int64
        type: integer
        x-entity-path: fileUploadJobIdentifier/uniqueID
      jobEndDateTime:
        description: The date and time that the file export job ended.
        format: date-time
        type: string
        x-entity-path: processFile/endTime
      jobStartDateTime:
        description: The date and time that the file export job started.
        format: date-time
        type: string
        x-entity-path: processFile/startTime
      jobStatus:
        description: |
          The status of the file export job. Available values:
          * Canceled
          * Complete
          * Failed
          * New
          * Processing
        enum:
          - Canceled
          - Complete
          - Failed
          - New
          - Processing
        type: string
        x-entity-path: processFile/status
      path:
        description: The full path of the exported file.
        type: string
        x-entity-path: uploadFile/fileInfo/filePath
      size:
        description: The file size (in bytes).
        format: int64
        type: integer
        x-entity-path: uploadFile/fileInfo/fileSize
      summaryReport:
        description: The summary report of the file processing information.
        type: string
        x-entity-path: processFile/processInfo
      type:
        description: |
          The type of the file export process. Available values:
          * CustomerSegmentExport
          * PromotionCodeExport
        enum:
          - CustomerSegmentExport
          - PromotionCodeExport
        type: string
        x-entity-path: uploadType
      userName:
        description: The name of the user that exported the file.
        type: string
        x-entity-path: uploadFile/userName
    type: object
    x-entity-class: com.ibm.commerce.content.facade.datatypes.FileUploadJobType
  FileExportJobCollection:
    description: The collection of file export jobs.
    properties:
      count:
        format: int64
        type: integer
      items:
        items:
          $ref: '#/definitions/FileExportJob'
        type: array
    type: object
x-components: {}

