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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
wkeicher
Helper III
Helper III

API Calls with Parameters = need help

Need Help with Invoking API Call with Paramaters.

 

The API call is as follows. I am passing in the paramater (newsdate)

https://api.sportsdata.io/v3/nba/scores/json/NewsByDate/2020-MAR-08

 

getapidata.png

 

When I invoke the following:

invoke.png

 

I get the following error

error.png

 

I believe this has to do with formatting the Parameter, but it has numbers and characters.

 

Assistance would be greatly appreciated.

1 ACCEPTED SOLUTION

@amitchandak @v-yuta-msft 

 

I actually figured it out. I had to declare the (newsdate as text) =>

Source = Json.Document(Web.Contents(Text.From("https://api.sportsdata.io/v3/nba/scores/json/NewsByDate/"&(newsdate)&"

 

Thanks for your guidance.

View solution in original post

5 REPLIES 5
v-yuta-msft
Community Support
Community Support

@wkeicher ,

 

You need to convert date to text type like below:

Text.From(newsdate)

 

Or use query parameter instead and try again, please refer to:

https://docs.microsoft.com/en-us/power-query/power-query-query-parameters

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you for the response.

 

It seems I still have a formatting issue. Teh URL has specific requirements when passing the date - YYYY-MMM-DD or 2020-MAR-07.

input.pngformat.png

Thanks,

Wayne

@wkeicher ,

 

I would suggest you to use fiddler to catch the actual http request and check if the URL in fiddler is same with that in power query.

 

Regards,

Jimmy Tao

@amitchandak @v-yuta-msft 

 

I actually figured it out. I had to declare the (newsdate as text) =>

Source = Json.Document(Web.Contents(Text.From("https://api.sportsdata.io/v3/nba/scores/json/NewsByDate/"&(newsdate)&"

 

Thanks for your guidance.

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.