I'm making a call to the FME Server API to get a list of Schedules and I'm getting back "raw" encoded strings in the json response, but I would like the "values". Is there any way to do it?
Here's an example request, which uses a token that I set up in FME Server (the token only has access to the Schedules) :
I tried changing the "response encoding" to the system default but it didn't make a difference.
Any ideas?
Best answer by hollyatsafe
batesy wrote:
Hi @virtualcitymatt , I added an "Accept" header to accept application/json but it didn't make any difference, I still get "raw" and not "value". The "Response Body Encoding" only has binary/unicode/latin, etc encoding options :
The Published Parameters in the Schedule are text.
I also tried getting the Schedules via the API doc "Try me out" option using the same token and got the same results :
The token only has Access privileges to Schedules. However, if I grant it "All permissions" I get "values" not "raw" which is what I want, so I suspect that the token needs more privileges than just "Access" to the Schedules. 🙂
Great detective work! I observe the same issue that if a token is granted 'Access' to the Schedules Item only, all the Schedules are returned but the published parameters return "raw" rather than "value" keys. In my testing, it looks like if you set 'Read' permissions for the Repository the scheduled workspace is stored in this should be enough to get the correct result returned - instead of giving the token all permissions.
I will be filing an issue to request a fix, but that being said, in my testing the raw values always showed the correct characters and never the encoded <> values. What parameter type is your URLAttribute and was the workspace created in FME Desktop 2021 or an older version?
Hi @virtualcitymatt , I added an "Accept" header to accept application/json but it didn't make any difference, I still get "raw" and not "value". The "Response Body Encoding" only has binary/unicode/latin, etc encoding options :
The Published Parameters in the Schedule are text.
I also tried getting the Schedules via the API doc "Try me out" option using the same token and got the same results :
The token only has Access privileges to Schedules. However, if I grant it "All permissions" I get "values" not "raw" which is what I want, so I suspect that the token needs more privileges than just "Access" to the Schedules. 🙂
Hi @virtualcitymatt , I added an "Accept" header to accept application/json but it didn't make any difference, I still get "raw" and not "value". The "Response Body Encoding" only has binary/unicode/latin, etc encoding options :
The Published Parameters in the Schedule are text.
I also tried getting the Schedules via the API doc "Try me out" option using the same token and got the same results :
The token only has Access privileges to Schedules. However, if I grant it "All permissions" I get "values" not "raw" which is what I want, so I suspect that the token needs more privileges than just "Access" to the Schedules. 🙂
Wow crazy find about the permissions. This sounds like a bug to me. Perhaps @jennaatsafe or @andreaatsafe can pass it to the dev team to look at.
Hi @virtualcitymatt , I added an "Accept" header to accept application/json but it didn't make any difference, I still get "raw" and not "value". The "Response Body Encoding" only has binary/unicode/latin, etc encoding options :
The Published Parameters in the Schedule are text.
I also tried getting the Schedules via the API doc "Try me out" option using the same token and got the same results :
The token only has Access privileges to Schedules. However, if I grant it "All permissions" I get "values" not "raw" which is what I want, so I suspect that the token needs more privileges than just "Access" to the Schedules. 🙂
Great detective work! I observe the same issue that if a token is granted 'Access' to the Schedules Item only, all the Schedules are returned but the published parameters return "raw" rather than "value" keys. In my testing, it looks like if you set 'Read' permissions for the Repository the scheduled workspace is stored in this should be enough to get the correct result returned - instead of giving the token all permissions.
I will be filing an issue to request a fix, but that being said, in my testing the raw values always showed the correct characters and never the encoded <> values. What parameter type is your URLAttribute and was the workspace created in FME Desktop 2021 or an older version?
Great detective work! I observe the same issue that if a token is granted 'Access' to the Schedules Item only, all the Schedules are returned but the published parameters return "raw" rather than "value" keys. In my testing, it looks like if you set 'Read' permissions for the Repository the scheduled workspace is stored in this should be enough to get the correct result returned - instead of giving the token all permissions.
I will be filing an issue to request a fix, but that being said, in my testing the raw values always showed the correct characters and never the encoded <> values. What parameter type is your URLAttribute and was the workspace created in FME Desktop 2021 or an older version?
Hi @hollyatsafe , thanks for the reply! You're spot on - the token needs read access to the repository. That's great to know! 😀
The published parameters I'm using are just text, nothing fancy. I'm using FME Database Edition (node locked-crc) 2021.0.3.0 (20210528 - Build 21326 - WIN64) and FME Server 2021.0.3 Build 21326 - win64.
For anyone else that ever has a similar problem, I ended up writing a function in a PythonCaller to decode the raw strings :
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.