I’m trying to access the API through my V3 iFrame and having trouble.
This article is really helpful for doing so with the V2 iFrame:
But I’m unable to find supporting documentation regarding how I may interact with the V3 iFrame through the API. Ideally, I could get the API object from outside of the iframe. For example, saving to the window object seems to have been doable with V2. Does the API reflector exist anymore?
Also, I noticed a dead link on the page under “API differences when embedding an iframe”. I’m not sure if this link would have been helpful.
On the other hand, if this is not the case, then is the typescript library my best shot?
Thanks so much for your time. Maintaining technical forums is tough work.
The viewer API feature is now only available through direct embedding of your ShapeDiver models, and not through the iframe anymore. The iframe version of the API had many limitations in the first place. You can check the difference between iframe embedding and direct embedding on the pricing page.
Does this mean that -when using the iFrame- it is not possible to use any API functionality at all?
In my use case, I will need to save/set parameters state as described here:
Plus, I will need to extract some values using direct data output, in order to display them in the html or for price calculations.
I would like to achieve this without having to design my own parameter interface, which is some extra work I do not need nor want at this stage.
Can you confirm if it is possible to directly embed the viewer, while still using the default parameter interface? I just quickly went through the viewer documentation and some of the sandbox example, but I could not find an answer.
You are correct that it is not possible to use any functionality at all through iframe embedding. It is also not possible at the moment to directly embed models and get the same UI as in the iframe. The reason for this is that the dependency for all UI elements is nested in the new ShapeDiver platform and it would be overblown to include all these dependencies for embedding a single ShapeDiver model.
We have produced a code example with a simple UI that you could use as is or customize a little using some basic CSS: UI example - CodeSandbox
There is no plan to allow API access from the iframe in the future, for technical and product-related reasons. We will add a functionality close to was @kiteboardshaper suggested related to saving/loading parameters. We will also add an output explorer that allows to display the value contained in data outputs.