Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
naveenvnit
Frequent Visitor

Could not extract response: no suitable HttpMessageConverter found for response type java.lang.Objec

I'm getting below exception for the Power BI rest API when I was trying to consume it from the Spring Boot rest application. https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}/ExportTo

 

Exception

--------------

Could not extract response: no suitable HttpMessageConverter found for response type [class java.lang.Object] and content type [application/pdf]

 

I have tried setting up the messageConverters to the RestTemplate in the two ways and neither didn't work for me.

 

ByteArrayHttpMessageConverter byteArrayHttpMessageConverter = new ByteArrayHttpMessageConverter();
List<MediaType> supportedApplicationTypes = new ArrayList<>();
MediaType pdfApplication = new MediaType("application","pdf");
supportedApplicationTypes.add(pdfApplication);
byteArrayHttpMessageConverter.setSupportedMediaTypes(supportedApplicationTypes);
List<HttpMessageConverter<?>> messageConverters = new ArrayList<>();
messageConverters.add(byteArrayHttpMessageConverter);
template.setMessageConverters(messageConverters);


List<HttpMessageConverter<?>> messageConverters = new ArrayList<>();
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
converter.setSupportedMediaTypes(Collections.singletonList(MediaType.ALL));
messageConverters.add(converter);
template.setMessageConverters(messageConverters);

 

1 REPLY 1
lbendlin
Super User
Super User

The Power BI REST API doesn't speak Java.  It returns JavaScript or binary payloads.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors