Get diagram picture from DM with OSLC
![](http://jazz.net/_images/myphoto/ad23f439e7af027542bc18a089ec359a.jpg)
One answer
![](http://jazz.net/_images/myphoto/ad23f439e7af027542bc18a089ec359a.jpg)
The recommended way is to use the OSLC specifications to get the Diagram preview which includes in the expanded form the diagram image.
The URI will be something like this:
https://localhost:9443/dm/_ajax-modules/rmps.web.app.ResourceLinkViewer?resourceUri=https%3A%2F%2Flocalhost%3A9443%2Fdm%2Fmodels%2F_qQ9Bwgp8EeWGMPdW6ZQc2w~GUID__613d0d38-d350-4ad4-9720-0ef268204eec&isExpanded=true&projectArea=Rhapsody%20Sample%20Project&rmps.context=https%3A%2F%2Flocalhost%3A9443%2Fdm%2Fstreams%2F10
If you want the image only, you can use the following API (internal, subject to change):
https://<localhost>:9443/dm/diagrams/image?diagramUri=<encoded diagram uri>&rmps.context=<encoded context uri>
ex.
https://localhost:9443/dm/diagrams/image?diagramUri=https%3A%2F%2Flocalhost%3A9443%2Fdm%2Fmodels%2F_qQ9Bwgp8EeWGMPdW6ZQc2w~GUID__613d0d38-d350-4ad4-9720-0ef268204eec&rmps.context=https%3A%2F%2Flocalhost%3A9443%2Fdm%2Fstreams%2F10
The URI will be something like this:
https://localhost:9443/dm/_ajax-modules/rmps.web.app.ResourceLinkViewer?resourceUri=https%3A%2F%2Flocalhost%3A9443%2Fdm%2Fmodels%2F_qQ9Bwgp8EeWGMPdW6ZQc2w~GUID__613d0d38-d350-4ad4-9720-0ef268204eec&isExpanded=true&projectArea=Rhapsody%20Sample%20Project&rmps.context=https%3A%2F%2Flocalhost%3A9443%2Fdm%2Fstreams%2F10
If you want the image only, you can use the following API (internal, subject to change):
https://<localhost>:9443/dm/diagrams/image?diagramUri=<encoded diagram uri>&rmps.context=<encoded context uri>
ex.
https://localhost:9443/dm/diagrams/image?diagramUri=https%3A%2F%2Flocalhost%3A9443%2Fdm%2Fmodels%2F_qQ9Bwgp8EeWGMPdW6ZQc2w~GUID__613d0d38-d350-4ad4-9720-0ef268204eec&rmps.context=https%3A%2F%2Flocalhost%3A9443%2Fdm%2Fstreams%2F10