Import and Export Service

The Flow of Import

  1. Upload file to object storage, get fileID in response.
  2. Call import api with fileID parameter and outputType(1 output unit file; 2 output to json data), then get taskID in response.
  3. Polling to get async exchange task result, get status in response:
    • pending: need to continue polling againt.
    • done: exchange success, can get import.jsonID or import.unitID in reponse.
    • failed: exchange failed, can get error.message for infomation.
  4. If you want to get json data instead unit file, use import.jsonID to get exchange result by call get file api.
import

The Flow of Export

  1. Call export api with unitID parameter, get taskID in response.
  2. Polling to get async exchange task result, get status in response:
    • pending: need to continue polling againt.
    • done: exchange success, can get export.fileID in reponse.
    • failed: exchange failed, can get error.message for infomation.
  3. Use export.fileID to get exchange result by call get file api.
export

API

see Univer Server API

A import demo: https://github.com/dream-num/usip-example/tree/main/import


Was this page helpful?