Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hello there,
I am trying to save contents of a json object from the API endpoint code. Currently my code looks like this.
The code is written in a python function as part of a API endpoint which receives data in form of a json object.
client = dataikuapi.DSSClient(host, apiKey)
client._session.verify = False
project = client.get_project("XXXXXXXX")
managedfolder = project.get_managed_folder("XXXXXXXXX")
jsonData = data.to_json()
managedfolder.put_file('data1.json',jsonData)
When I run the above code, i get the below error while executing via Testing Queries
Failed: Failed to run function : class 'dataikuapi.utils.DataikuException': com.dataiku.dip.exceptions.UnauthorizedException: Action forbidden
Hi @ssuhas76 ,
Action forbidden usually indicates the API key you are using doesn't have permission to write to this managed folder.
You should be able to replicate this in a notebook as well when setting a remote client.
What type of API key are you using? Personal/Project?
You can use a project API key but need to provide access to read/write from the project permissions + for the respective managed folder.
THanks
Hi @ssuhas76 ,
Action forbidden usually indicates the API key you are using doesn't have permission to write to this managed folder.
You should be able to replicate this in a notebook as well when setting a remote client.
What type of API key are you using? Personal/Project?
You can use a project API key but need to provide access to read/write from the project permissions + for the respective managed folder.
THanks
Thanks it solved for me. I am using a project level API key. I turned on the writeprojectcontent permission to true. It is working now.