Get started
API documentation static link https://xmaxprint.ca/api-documentation
The X-Max Print API provides programmatic access to read and update the materials catalogue used by the X-Max Print plugin. The API uses the GET method to access data currently in the database and the POST method to add or update records.
The use of this API requires an API key that can be requested from X-Max Print directly based on a justified need as stated in the agreement signed by a registered corporation and X-Max Print Inc.
Requesting an API key
Use contact form at https://xmaxprint.ca to request API key
To request an API key, please reach out to using the contact form available in the footer of our website (https://xmaxprint.ca)
All requests will be vetted individually and must include a justified need and proof of planned or ongoing cooperation signified by a written agreement.
Using the API key
API Endpoint https://api.xmaxprint.ca/ Example API key: '7hZCYO3SnY9WBHHherYrJQ' Basic HTTP curl example of API key use: curl -s --user 'api:7hZCYO3SnY9WBHHherYrJQ' \ https://api.xmaxprint.ca/v1/YOUR_USERNAME/ \
If your request for an API key is approved, you will receive it and will be able to access our API using it. We will also add your company name to our database and provide you with a username to use alongside the API key for authentication purposes.
Please refer to a basic curl HTTP example to the right on how to use your API key to authenticate yourself.
GET method functionality
Using GET method to access all materials in the database: curl -s --user 'api:7hZCYO3SnY9WBHHherYrJQ' \ https://api.xmaxprint.ca/v1/YOUR_USERNAME/materials \ Sample results when querying all materials: result: [ { uid: 3sa212, manufacturer: "3M", uses: { "business cards", "flyers", "letterheads" }, available: true, weight: "300GSM", finish: "matte", type: "budget" }, { uid: 4521a2, manufacturer: "Domtar", uses: { "flyers", "letterheads" }, available: true, weight: "140GSM", finish: "matte", type: "budget" }, { uid: 2f2hx2, manufacturer: "3M", uses: { "business cards", "greeting cards", "invitation cards", "book covers" }, available: true, weight: "350GSM", finish: "gloss", type: "corporate" } ... ]
A GET request allows you to use the internet to download data from a data source. It is carried out via the GET request technique, a popular HTTP request method (like POST, PUT, or DELETE).
Despite being capitalised, "GET" is not an acronym and has no meaning. However, by picturing the GET method as "GETting" data from a source, it is simple to comprehend how it works.
Any provided HTTP GET API must return HTTP response code 200 (OK) and the response body, which is often either XML or JSON content, if the requested resource can be discovered on the server (due to their platform-independent nature).
The API must provide HTTP response code 404 if the requested resource cannot be located on the server (NOT FOUND).
The server will also return the HTTP response code 400 if it is found that the GET request itself was not properly constructed (BAD REQUEST).
POST method functionality
Using the POST method to add a material: curl -s --user 'api:7hZCYO3SnY9WBHHherYrJQ' \ https://api.xmaxprint.ca/v1/YOUR_USERNAME/materials/post \ Sample JSON packet: { "manufacturer": "Vertiv", "uses": { "book covers", "binder dividers", "presentation folders" }, "weight": "450GSM", "finish": "silk", "type": "classic" } Sample server response: HTTP/1.1 200 OK Content-Type: application/json {"success":"true"}
A new subordinate resource is created by a POST method, for example, a file is subordinate to the directory in which it is located or a row is subordinate to a database table.
Without the proper Cache-Control or Expires header values, responses to this method are not cacheable.
The response SHOULD be HTTP response code 201 (Created) and include an entity that specifies the status of the request, refers to the new resource, and a Location header if the resource has been created on the origin server.
Many times, the POST method's operation doesn't provide a resource that can be referenced by a URI. The response status in this scenario is either 204 (No Content) or HTTP response code 200 (OK).
Errors
The X-Max Print API uses the following error codes:
Error Code | Meaning |
---|---|
X000 | Some parameters are missing. This error appears when you don't pass every mandatory parameters. |
X001 |
Unknown or invalid secret_key . This error appears if you use an unknown API key or if your API key expired.
|
X002 |
Unknown or invalid username for this domain. This error appears if you use a username that is not authorized for use with the API.
|