Uploading images

To upload an image you can query the Voxel API for an upload URL. A REST PUT request to this URL can be used to upload an image.

Arguments

  • orderIdID!
    The order ID. The corresponding order needs to have the status PENDING_UPLOAD.
  • pathString!
    The full image path including extension. This path will be used to create a folder structure for your output images.

Result

The result is a signed URL. This URL can be used to upload an image to the previously specified order. Each generated URL can be used only once and only for a limited amount of time. To upload the image do a REST PUT request to this URL.

type Query {
    uploadUrl(orderId: ID!, path: String!): String!
}

EXAMPLE

{
    uploadUrl(orderId: "O1726", path: "test.png")
}

RESULT

{
  "data": {
    "uploadUrl": "https://storage.ymage.com/test.png?Key=AKIAEXAMPLEACCESSKEY&Signature=EXHCcBe%EXAMPLEKnz3r8O0AgEXAMPLE&Expires=1555531131"
  }
}
# example file upload using curl
curl --upload-file test.png "https://storage.ymage.com/test.png?Key=AKIAEXAMPLEACCESSKEY&Signature=EXHCcBe%EXAMPLEKnz3r8O0AgEXAMPLE&Expires=1555531131"