Media entities - Intergraph Smart API Manager - 5.0 - Help

Intergraph Smart API Manager Help

Language
English
Product
Intergraph Smart API Manager
Search by Category
Help
Smart API Manager Version
5.0

If you examine metadata for the SampleService Smart API, you will notice that the ReportInstance entity contains the HasStream="true" attribute and value, meaning that report instances support a media stream:

<EntityType Name="ReportInstance" BaseType="Com.Ingr.Core.V1.DynamicEdmEntityObject" OpenType="true" HasStream="true">

<Property Name="ExecutedDateTime" Type="Edm.DateTimeOffset" Nullable="false" />

<Property Name="ExecutedBy" Type="Edm.String" />

<Property Name="Parameters" Type="Edm.String" />

</EntityType>

If you request full metadata for a report instance:

GET https://sam.spclouddave.com/SampleService/sppid/v2/Pipes('302')/Reports('Report 302')/Instances('1583')?$format=application/json;odata.metadata=full

the response contains additional odata links, two of which deal with available media content:

{

"@odata.mediaEditLink": "Pipes('302')/Reports('Report 302')/Instances('1583')/$value",

"@odata.mediaContentType": "image/jpeg",

}

In this example, you can call the following resource to get a jpeg image associated with the report instance:

GET https://sam.spclouddave.com/SampleService/sppid/v2/Pipes('302')/Reports('Report 302')/Instances('1583')/$value

SHARED Tip In the SampleService Smart API, the JSON response body returned from Com.Ingr.Core.V1.ExecuteReport includes a Url value that contains the corresponding media entity link.