Chameleoon MAX · Assets
createAsset mutation
createAsset is a GraphQL mutation of the Chameleoon MAX API. Send it as POST https://max-api.chameleoon.sk/api/v1/graphql with your API key, see Chameleoon MAX.
Creates an asset from an image you uploaded. Call it after the upload to give the image a code that print templates and e-mails can refer to.
Upload the image first through POST /api/v1/assets/files (multipart, field file): a PNG or
JPEG of at most 2 MiB and 4 000 000 pixels. Pass the returned fileId here.
Permissions
- Requires the
company.writepermission. - A company's asset also requires the company in your API key's legal-entity scope.
Errors
| Code | Reason | When |
|---|---|---|
CONFLICT | DUPLICATE_CODE | An asset with the same reference already exists (field code). |
CONFLICT | FILE_ALREADY_ATTACHED | The uploaded file is already used. Upload it again. |
NOT_FOUND | The file does not exist or has expired (extensions.field fileId), or the company does not exist (extensions.field legalEntityId). | |
VALIDATION | CODE_SHAPE | The code has the wrong shape. |
VALIDATION | NOT_PUBLISHABLE | isPublic is true on a stamp. |
VALIDATION | TOO_MANY_PIXELS, UNREADABLE_IMAGE | The image has too many pixels or cannot be read (field fileId). |
Arguments
input:CreateAssetInput!· required
Returns
Example
Mutation
Code
Variables
Code
Response
Code
Values are illustrative: replace IDs and codes with your own before you send the call.