Export & Import Process Description

607

After the Export/Import request was made, as a response, you will receive the Job State Object back.

{
  data: {
    jobId: "618baf6ae5894600269d7c1b",
    jobState: "created",
    jobType: "EXPORT",
    metadata: {
      finalReport: [],
      languageGuid: "a6ok64-37ff-4466-a70b-c88a91cfec12",
      languageId: -1,
      …
    },
    progress: 0,
    stage: "initializing",
    startedAt: "2021-11-10T11:39:22.199Z",
    userId: 346086
  }
}

Use the Job State API to get the current status of the Job. Continue pulling until the job is finished.

{
  data: {
    endedAt: "2021-11-10T11:39:30.155Z",
    errorMessage: null,
    jobId: "618baf6ae5894600269d7c1b",
    jobState: "completed",
    jobType: "EXPORT",
    metadata: {
      assetId: "1636544369887_Default_346086.xliff",
      fileType: "XLIFF",
      finalReport: [],
      languageDisplayName: "",
      languageGuid: "a6ok64-37ff-4466-a70b-c88a91cfec12",
      languageId: -1,
      transactionId: "2854bd74-9819-495a-8c34-564a62c15609"
    },
    progress: 100,
    stage: "finish",
    startedAt: "2021-11-10T11:39:22.199Z",
    userId: 346086
  }
}

In case of an error, the errorMessage field will not be empty and jobState value will be “failed”.

{
  "data": {
    "jobId": "61a6306428013500249fd58c",
    "userId": 346086,
    "jobType": "EXPORT",
    "jobState": "failed",
    "startedAt": "2021-11-30T14:08:36.510Z",
    "endedAt": "2021-11-30T14:08:36.645Z",
    "metadata": {
      "finalReport": [ ],
      "languageGuid": "0fd46fa1-7727-46ce-95e1-f851b2e14702",
      "languageId": null,
      "transactionId": "bd77f14a-cfeb-4c48-8c40-68d43bc9faf3",
      "languageDisplayName": "",
      "fileType": "XLIFF",
      "assetId": null
    },
    "progress": 10,
    "stage": "receiving translations data",
    "errorMessage": "internal server error"
  }
}

In order to get the exported/imported file with translations - Take the assetId value from the metadata object and use the Asset API to get the link to the file.