sync_images
Retrieve a list of images that have changed.
Arguments
[String!]!)
An array of content hashes for images the client has previously retrieved. The server will return images whose content hashes do not match the client's content hashes.
ID!)
The ID of the survey containing the images to be synced.
Return fields
[SyncItem!]!)
Items that have been deleted.
[SyncError!])
A list describing errors that occurred during the syncing process.
Int!)
The number of items remaining to be synced.
[SyncItem!]!)
Items that have been inserted or updated.
Examples
Sync images for a survey
This query is used by a client to sync images for a specific survey with images stored on the server. This query will return up to the first 1,000 images in a survey that are different than the images held by the client. To retrieve the remaining images, a client should call this query repeatedly, passing in the full set of content hashes for images it holds, until no more images are returned, or the remaining count returned is 0.
Try this example in GraphiQLquery SyncSurveyImages {
sync_images(
survey_sentera_id: "itqkn28_CO_SHORT1_CV_test_dc0d87d_170907_235328"
content_hashes: [
"xdNDk/aet07YA1pi"
"/h9Kp8h1wLAR77g6"
"pZCIzimW+sJQ1tPP"
"zShxQoCpBmIvKQzg"
"qYcc+5d0r6xXrJ+B"
"1RUHdRg7eewn5Ytc"
"jut/CTgwHV4nPhHU"
"3mT/9ITHMbrufod3"
"Frw7c/jWXG0DGhDp"
"szY6ppzZ4mJKUK//"
"szOWioO7aPh41tns"
"aHhl10uJY5pP8x5Y"
"s8O1QwaYex8nMGIt"
"2iZuIOjIq9GToC1k"
"nZ21khXOu5k96QNW"
]
) {
remaining_count
upserted {
sentera_id
content_hash
... on Image {
latitude
longitude
filename
created_by {
sentera_id
}
updated_by {
sentera_id
}
}
}
deleted {
sentera_id
content_hash
}
}
}
{
"data": {
"sync_images": {
"remaining_count": 744,
"upserted": [
{
"sentera_id": "jkxco43_IM_SHORT1_CV_test_dc0d87d_170907_235328",
"content_hash": "XWbX2szIhrApOpVW",
"latitude": 45.328761,
"longitude": -93.521094,
"filename": "86d4b80ce100-FW00024.jpg",
"created_by": {
"sentera_id": "rczsi42_US_8brhbkSentera_CV_stag_e3e4835_210209_171134"
},
"updated_by": {
"sentera_id": "rczsi42_US_8brhbkSentera_CV_stag_e3e4835_210209_171134"
}
}
],
"deleted": [
{
"sentera_id": "dfaxv57_IM_SHORT1_CV_test_dc0d87d_170907_235328",
"content_hash": "DwnxuWkm8Lo6bC5R"
}
]
}
}
}