Skip to main content

parseImage

The parseImage mutation allows you to use Kargo templates to parse your own images.

It's as simple as issuing a curl command:

curl https://api.kargo.zone/public_graphql \
-F operations='{
"query": "mutation ($file: Upload!) {parseImage(input:{businessSlug:\"<business_slug>\",facilitySlug:\"<facility_slug>\",file:$file,metadata:[{key:\"<id1name>\",value:\"<id1>\"}]}){readResults{name value confidence}}}",
"variables": {
"file": null
}
}' \
-F map='{
"0": ["variables.file"]
}' \
-F 0=@image_path.jpg \
--header "authorization: Bearer ABCD_ACCESS_TOKEN_ABCD"

Where image_path.jpg is pointing to your image.

Or using a GraphQL client in your language of choice. You can also use the GraphQL Sandbox explained in the authentication docs.

It returns results which will be empty until the Kargo operations team has had the change to set up your template.

{
"data": {
"parseImage": {
"readResults": []
}
}
}

But then the results will return with the values and confidences of each of the fields your label contains

{
"data": {
"parseImage": {
"readResults": [
{
"name": "sku",
"value": "00012345678",
"confidence": 0.1
},
{
"name": "lot",
"value": "A1B",
"confidence": 0.5
}
]
}
}
}
parseImage(
input: ParseImageInput!
): ParseImageResult!

Arguments

parseImage.input ● ParseImageInput! non-null input

Type

ParseImageResult object

Returns the results of the kargo parse image mutation. These results will be contianed in readResults.

The requestId can be used to link to a specific run for the image parsing and can be useful to save in case you have any questions about a specific request and its results.

TemplateIds will return the templates that were matched for this specific parse image request, this ID will be internal to kargo, but again can be useful for any inquiries into performance.

Metadata will return any customer supplied metadata for this parse image request along with any Kargo metadata.