Files

Upload a visual to a signed URL

PUT/v2/uploads/{token}Try it

The uploadUrl of createFileUpload: send the file's bytes as the body, with its Content-Type. No Authorization header: the token stands in for it. Callable from a browser on any origin (CORS, with its preflight). The content must match the type announced when the URL was made. Limited per IP address (RATE_LIMITED, with Retry-After).

Request

Authorization

None: this route answers without an API key.

Path parameters
  • tokenstringrequired
    The signed token, as uploadUrl holds it
Body image/png

Responses

201The file is stored
400Empty body (EMPTY_BODY), or content that is not the announced type (CONTENT_TYPE_MISMATCH)

Type: Error

401Forged or expired token, or one made for another use (INVALID_UPLOAD_TOKEN)

Type: Error

403A live URL used on the sandbox host (SANDBOX_REQUIRES_TEST_KEY)

Type: Error

409The URL already stored its file (UPLOAD_LINK_USED): ask for a new one

Type: Error

413Over 25 MB (FILE_TOO_LARGE)

Type: Error

422A PDF that cannot be prepared for print (INVALID_FILE)

Type: Error

429Too many uploads from this address (RATE_LIMITED)

Type: Error

500Internal server error (UPLOAD_FAILED)

Type: Error

Request
curl -X PUT "https://api.printags.com/v2/uploads/{token}"
Response 201
{
  "success": true,
  "file": {
    "fileId": "f0000000-0000-4000-8000-000000000009",
    "name": "recto.png",
    "size": 182044,
    "contentType": "image/png"
  }
}