Design Job
For real-time reference and debugging, please check the GitHub implementation.
The API Request creates a link to embed the editor in an iframe. This link automatically authenticates the user and is only valid for a short period. It requires the Customer GUID and the Product ID.
You can specify several parameters in the request:
id: This is the Customer GUID.
productId OR SKU: This represents the Infigo Product ID or the product SKU.
errorUrl (optional): Redirects the user in case of authentication errors.
embeddedOperationMode: Set this to "true" when embedding MegaEdit; otherwise, you can omit this parameter.
The response will return a URL containing a temporary AutoLogin token, which should be inserted into your iframe's src
.
To capture specific events that occur in the editor, you must include our JavaScript library on your iframe's parent page (see resources). This library allows you to capture events, such as the 'Add to basket' click event. When this event occurs, you need to capture the Job ID included in the event data, as it is required later in the order placement process to ensure the correct output is generated.
You can also extend the integration to allow for editing existing jobs (either from the basket or saved projects). To do this, pass the ID as the orderlineItemId
parameter. If you need to support saved projects, you can capture and handle the 'Save project' event in the editor through the JavaScript communicator library, storing the ID and directing the customer to their account.
Sample request:
For more details on the required parameters and how to construct the request effectively, refer to the implementation in the getEditorLinkFor file on GitHub.
Important:
To achieve proper iframe integration, you will need to utilize the
XDCommunicator library
InfigoCommunicator library