Quotations
Before you can use the Quotations API, you need to enable user authentication!
A quotation in DynaMaker is a way of integration between your dynamic tool and your product portal (or any system that you wish). The intended flow of events is as follows:
- The end user of your dynamic tool configures the product to their liking
- The end user requests a quotation from a button in the dynamic tool
- The dynamic tool generates related files such as custom product drawings
- The file are uploaded to the Quotations REST API
- A
quotation.created
event is sent to your product portal by a webhook - Your other system confirms the webhook event creates or updates its own quotation entity
- The end user can view their quotation in your product portal and optionally view the product drawing
Plugin
A quotation request can be created from your dynamic tool by using the Quotations plugin.
Configuring
The Quotations plugin can be configured from the plugins section of your DynaMaker app dashboard.
Example Code
async function publishQuotation() {
const exampleDrawing = new SKYDRAWING.Drawing()
exampleDrawing.addPage(1)
exampleDrawing.addContent(1, SKYCAD.generateCircleSketch(10, 100, 50))
const pdfDataUrl = await exampleDrawing.generatePdfDataUrl()
return PLUGINS.QUOTATION.publish({
files: [{ data: pdfDataUrl, name: 'example-drawing.pdf', type: 'pdf' }],
})
}
REST API
With the Quotations REST API you can fetch information and files related to quotation requests that have been made in your dynamic tool.
Authentication
All requests to the API must include the secret that can be found in the Quotations plugin in the app dashboard in DynaMaker. Add it to the request header as a bearer token:
GET https://deployed.dynamaker.com/applications/<projectId>/quotation/publications
Authorization: Bearer <quotationSecret>
Fetching Files
It is common to publish files such as PDF or DXF drawings when creating a quotation request. All such files have a
unique fileId
. The best way to get it is from the quotation.created
webhook event. When you have
the fileId
and your quotation secret (see the authentication section on this page), getting the file is as simple as
making a GET request:
GET https://deployed.dynamaker.com/applications/<projectId>/quotation/files/<fileId>
Authorization: Bearer <quotationSecret>
Use With Node.js
If your server is using Node.js, the official npm package makes it simple to integrate with the API! Find out how to use it here!