Select to view content in your preferred language

Truncate HFL using HTTP task in Power Automate

68
1
Jump to solution
Monday
Labels (1)
DominicRoberge2
Occasional Contributor III

Hello

I am trying to truncate a hosted feature layer on AGOL using the REST API and Power Automate. I created an App in AGOL and I am using the client_id and client_secret to get a token. This seems to be working fine. But when I try to use the token I get the following error: User does not have permissions to access this service.

Any guidance would be much appreciated.

Thanks!

 

DominicRoberge2_0-1724689412213.png

the result is this: I am able to get a token but... I get the user does not have permissions to access this service

DominicRoberge2_1-1724689464812.png

DominicRoberge2_2-1724689556251.png

 

 

0 Kudos
1 Solution

Accepted Solutions
DominicRoberge2
Occasional Contributor III

OK, I solved my problem:

1) I was using the wrong URI... (https://www.arcgis.com/sharing/generateToken)

DominicRoberge2_0-1725027324381.png

2) I had to encrypt my credentials using the following expression in the body: 

concat('username=',encodeUriComponent('USERNAME'),'&password=',encodeUriComponent('PASSWORD'),'&referer=',encodeUriComponent('https://www.arcgis.com'))
 
this is working great!

 

 

View solution in original post

0 Kudos
1 Reply
DominicRoberge2
Occasional Contributor III

OK, I solved my problem:

1) I was using the wrong URI... (https://www.arcgis.com/sharing/generateToken)

DominicRoberge2_0-1725027324381.png

2) I had to encrypt my credentials using the following expression in the body: 

concat('username=',encodeUriComponent('USERNAME'),'&password=',encodeUriComponent('PASSWORD'),'&referer=',encodeUriComponent('https://www.arcgis.com'))
 
this is working great!

 

 

0 Kudos