upsert_images

Upsert (create and/or update) one or more images for a survey.

Input fields

images ([ImageImport!]!)

An array of ImageImport objects to upsert. The limit is 1000 images.

survey_sentera_id (ID!)

The ID of the Survey into which these Images will be upserted.

Return fields

failed ([UpsertError!]!)

Detailed error information for UpsertItems that failed to upsert.

succeeded ([UpsertItem!]!)

UpsertItems that have been successfully upserted.

Examples

Upsert Images

Upserts an array of images

Try this example in GraphiQL
mutation UpsertImagesExample {
  upsert_images(
    survey_sentera_id: "58ag1kg_CO_c9hoChrisOrg_CV_deve_ac5d85f7_190711_163140"
    images: [
      {
        size: 7705701,
        filename: "DJI_0058.JPG",
        camera_make: "camera",
        camera_model: "model",
        captured_at: "2019-07-12T15:30:00Z",
        orientation: 1,
        sensor_type: RGB,
        altitude: 320.5,
        latitude: 45.0,
        longitude: -93.0,
        pitch: 0.0,
        roll: 0.0,
        yaw: 0.0,
        gps_carrier_phase_status: STANDARD,
        gps_horizontal_accuracy: 0.0,
        gps_vertical_accuracy: 0.0,
        internal_use: false
      },
      {
        altitude: 320.6,
        latitude: 1111111111111,
        longitude: -93.0
      }
    ]
  ) {
    succeeded {
      sentera_id
      ... on Image {
        content_hash
        filename
        latitude
        longitude
        created_by {
          sentera_id
        }
        updated_by {
          sentera_id
        }
      }
    }
    failed {
      index
      item {
        sentera_id
        ... on Image {
          filename
        }
      }
      attributes {
        attribute
        key
        details
        message
      }
    }
  }
}

{
  "data": {
    "upsert_images": {
      "succeeded": [
        {
          "content_hash": "xdNDk/aet07YA1pi",
          "sentera_id": "aaubw4x_IM_c9hoChrisOrg_CV_deve_e29bc515_190716_162612",
          "filename": "DJI_0058.JPG",
          "latitude": 45.0,
          "longitude": -93.0,
          "created_by": {
            "sentera_id": "rczsi42_US_8brhbkSentera_CV_stag_e3e4835_210209_171134"
          },
          "updated_by": {
            "sentera_id": "rczsi42_US_8brhbkSentera_CV_stag_e3e4835_210209_171134"
          }
        }
      ],
      "failed": [
        {
          "index": 1,
          "item": {
            "sentera_id": "tdfrl78_IM_8brhbkSentera_CV_deve_a66dedf98_200410_121407",
            "filename": "DJI_0059.JPG"
          },
          "attributes": [
            {
              "attribute": "latitude",
              "key": "less_than_or_equal_to",
              "details": {
                "value": "1111111111111.0",
                "count": 90
              },
              "message": "must be less than or equal to 90"
            },
            {
              "attribute": "captured_at",
              "key": "blank",
              "details": {},
              "message": "can't be blank"
            }
          ]
        }
      ]
    }
  }
}