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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
k3rz0rg
Advocate III
Advocate III

How to use apostrophe (') in REST API url for weird email address!

Hi everyone,

 

I was trying to bulk remove a users from specific workspaces and using REST API (Admin - Groups DeleteUserAsAdmin) through powershell and putting the url after -url 'the api url' -method delete.

now the problem is the user has a weird email address like ab.c'd@xyz.com and cannot use this in the url since that apostrophe in the email end the url before d@xyz.com and the call becomes invalid. For example:

it supposed to be -url 'https://api.powerbi.com/v1.0/myorg/admin/groups/{groupId}/users/ab.c'd@xyz.com' but it becomes

-url 'https://api.powerbi.com/v1.0/myorg/admin/groups/{groupId}/users/ab.c'd@xyz.com' 

because that apostrophe after ab.c finishes the url code early.

 

Can somebody please give me any idea how to handle that apostrophe in the middle of API url code?

Also not sure if it's the right section for this request since this is not a desktop one but power bi service.

 

Thanks!

1 ACCEPTED SOLUTION
mariussve1
Solution Supplier
Solution Supplier

Hi.

 

Can you try to replace the apostrophe with %27

That should be the url encoding for '

 

https://api.powerbi.com/v1.0/myorg/admin/groups/%7BgroupId%7D/users/ab.c%27d@xyz.com

 

Br

Marius

View solution in original post

4 REPLIES 4
mariussve1
Solution Supplier
Solution Supplier

Hi.

 

Can you try to replace the apostrophe with %27

That should be the url encoding for '

 

https://api.powerbi.com/v1.0/myorg/admin/groups/%7BgroupId%7D/users/ab.c%27d@xyz.com

 

Br

Marius

If that does not work, maybe you can try %60

 

That is the escape code for '

Hehe.. I also se you might have to use $60 because that is the escape for the string '

 

Just trying to give you some options, so Sorry for all the answers. Would be great if you reply if any of the suggestions works.

 

Marius

@mariussve1 😅 Thank you for the suggestions and %27 worked for me 😄

I also found a HTML reference site listing all these weird characters hope someone might find useful through this thread later!

 

https://www.w3schools.com/tags/ref_urlencode.ASP

 

-K3 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors