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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
adarshmadrecha
Regular Visitor

Passing Cookie using Web.Contents in PowerBI Desktop

I have API which authenticates user based on Cookies (PHP Sessions)

 

I am using below code to pass cookies

 

= Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID:123abc"]]))

But the above code does not work.

Can you please help in finding out what I am doing wrong?

1 ACCEPTED SOLUTION
adarshmadrecha
Regular Visitor

I understood waht the issue was.

Instead of using : I sould use = to scecify cokie name and value.

 

= Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID=123abc"]]))

View solution in original post

3 REPLIES 3
adarshmadrecha
Regular Visitor

I understood waht the issue was.

Instead of using : I sould use = to scecify cokie name and value.

 

= Json.Document(Web.Contents("https://myapp.example.com/api/test.php", [Headers=[Cookie="PHPSESSID=123abc"]]))

Good morning. How did you manage to get the cookie from power bi? I am currently making a request to obtain the cookie, said cookie comes in the headers of the server response.

Thank you !

v-chuncz-msft
Community Support
Community Support

@adarshmadrecha,

 

You may take a look at link below.

http://www.excelandpowerbi.com/?p=58

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Europe Fabric Conference

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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