How to get the current model name through Viewer API?

viewer-api

(Dmitry Mot) #1

Hey Gents,
Could you advice pls is there any trick to get a model name loaded with viewer api?
I can't reach an iframe with .contents() and other js funcs due https policy.


#2

Hey Dmitry,

As far as I know, you cannot do it within the Viewer API, but you could separately use the Data API:

GET https://api.sketchfab.com/v2/models/MODEL_UID

Parse the JSON for response.name


(Dmitry Mot) #3

Thats work for me, thanks a lot!


#4

Glad to hear it, good luck with your project! Would love to know more.


(Dmitry Mot) #5

Thank you :slight_smile: