The colormass API is available at https://gql.colormass.com/graphql
Authentication
In the Headers tab, enter the demo API key to authenticate to the backend:
Copy {
"X-Api-Key" : "0ecff5f6-5b65-42bf-84d1-facf9ed37c7avf"
}
The following query will return download URLs for thumbnails/tileable images:
Copy query GetMaterialDownloadLink($articleId: String!, $organizationId: ID!, $assignmentType: DataObjectAssignmentType!, $resolution: DownloadResolution, $fileType: DownloadFileType) {
materials (filter: {articleId: {equals: $ articleId }, organizationId: {equals: $ organizationId }}) {
dataObjectAssignments(filter: { assignmentType : [$assignmentType]}) {
dataObject {
downloadUrl(resolution: $resolution, fileType: $fileType)
mediaType
}
}
}
}
For PBR maps, use this query:
Copy query GetPbrMaterialDownloadLink($articleId: ID!, $organizationId: String!, $resolution: DownloadResolution, $fileType: DownloadFileType) {
materials (filter: {articleId: {equals: $ articleId }, organizationId: {equals: $ organizationId }}) {
jsonFileAssignments(filter: {jsonFileContent: [{resolution: $resolution, fileType: $fileType, state: "done", default: true}]}) {
jsonFile {
outputDataObject {
downloadUrl
}
}
}
}
}
Follow this link to try the queries on live data. You will need to provide variables in this format:
Copy {
"organizationId" : "<your organization id>" ,
"articleId" : "<article id>" ,
"resolution" : "High" ,
"fileType" : "exr" ,
"assignmentType" : "MaterialThumbnail_20x20"
}
The required link is the downloadUrl
field of the first dataObject
of the first dataObjectAsssignment
returned, unless additional filter criteria apply (for example, you might want to filter by mediaType
to exclude zip files and only offer download links to images).