Skip to content
Go to Micro

Get the status of an import job

client.Prism.Imports.Get(ctx, jobID, query) (*PrismImportGetResponse, error)
GET/v2/prism/{teamId}/imports/{jobId}

Poll the status of an async import. Sync imports complete in the original response and don’t appear here. Async jobs are retained for 7 days. Returns 404 once the job has expired.

ParametersExpand Collapse
jobID string
query PrismImportGetParams
TeamID param.Field[string]Optional
formatuuid
ReturnsExpand Collapse
type PrismImportGetResponse struct{…}

Status snapshot of an import job. Same shape used by the POST /import response and by GET /imports/{jobId}.

JobID string

Null for sync imports (results inlined). Set for async imports.

Status PrismImportGetResponseStatus
One of the following:
const PrismImportGetResponseStatusComplete PrismImportGetResponseStatus = "complete"
const PrismImportGetResponseStatusProcessing PrismImportGetResponseStatus = "processing"
const PrismImportGetResponseStatusFailed PrismImportGetResponseStatus = "failed"
Total int64

Total number of rows in the import.

CreatedAt TimeOptional
formatdate-time
Error PrismImportGetResponseErrorOptional

Set when status=failed; describes the job-level failure (not per-row).

Code stringOptional
Message stringOptional
ExpiresAt TimeOptional
formatdate-time
Failed int64Optional
Processed int64Optional

Rows that have been attempted (succeeded + failed).

Results []PrismImportGetResponseResultOptional

Per-row outcomes. Always present for sync imports; populated for async imports once the job reaches complete.

ID stringOptional
formatuuid
Created boolOptional
Error PrismImportGetResponseResultsErrorOptional
Code stringOptional
Message stringOptional
Existing boolOptional

True if the row matched an existing record via the dedupe key.

Succeeded int64Optional
UpdatedAt TimeOptional
formatdate-time

Get the status of an import job

package main

import (
  "context"
  "fmt"

  "github.com/micro-so/micro-sdk-go"
  "github.com/micro-so/micro-sdk-go/option"
)

func main() {
  client := micro.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithTeamID("My Team ID"),
  )
  import_, err := client.Prism.Imports.Get(
    context.TODO(),
    "jobId",
    micro.PrismImportGetParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", import_.JobID)
}
{
  "job_id": "job_id",
  "status": "complete",
  "total": 0,
  "created_at": "2019-12-27T18:11:19.117Z",
  "error": {
    "code": "code",
    "message": "message"
  },
  "expires_at": "2019-12-27T18:11:19.117Z",
  "failed": 0,
  "processed": 0,
  "results": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created": true,
      "error": {
        "code": "code",
        "message": "message"
      },
      "existing": true
    }
  ],
  "succeeded": 0,
  "updated_at": "2019-12-27T18:11:19.117Z"
}
Returns Examples
{
  "job_id": "job_id",
  "status": "complete",
  "total": 0,
  "created_at": "2019-12-27T18:11:19.117Z",
  "error": {
    "code": "code",
    "message": "message"
  },
  "expires_at": "2019-12-27T18:11:19.117Z",
  "failed": 0,
  "processed": 0,
  "results": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created": true,
      "error": {
        "code": "code",
        "message": "message"
      },
      "existing": true
    }
  ],
  "succeeded": 0,
  "updated_at": "2019-12-27T18:11:19.117Z"
}