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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
soldous
Advocate II
Advocate II

Power BI REST API Bad Request Object must implement IConvertible.

Hi all,

 

I would like to use a new PBI API to get activity events but when I try to call the API I receive 400 bad request: Object must implement IConvertible for startDateTime and endDateTime. 

 

I have registered app in Azure Active Directory with Power BI Service Tenant.ReadAll permission.

For getting access token I call POST on https://login.microsoftonline.com/common/oauth2/token with body:

 

grant_type=password
&username=user with global admin permission
&password=password
&client_id=client ip
&client_secret=client secret
&resource=https://analysis.windows.net/powerbi/api

 

I used the received token for Bearer authorization on https://api.powerbi.com/v1.0/myorg/admin/activityevents?startDateTime=2020-01-20T00:00:00.000Z&endDa... and receive the error above.

 

Other APIs works fine.

 

Could anyone help, please?

Thanks a lot.

Regards,

Zdenek 

1 ACCEPTED SOLUTION
soldous
Advocate II
Advocate II

I talked with the support and the solution is to enclose dates in the single quotation marks.

 

Hope they changed it in the official documentation.

View solution in original post

2 REPLIES 2
soldous
Advocate II
Advocate II

I talked with the support and the solution is to enclose dates in the single quotation marks.

 

Hope they changed it in the official documentation.

When you manage to retrieve the first page, and in order to fetch the next page, you will need to pass the continutation token retrieved from the inital response.

Be aware that for this parameter, you also need to 'Uridecode' the token returned by the API and enclose it in single quotes.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.