Search the Community
Showing results for tags 'restful'.
-
Hi, I'm having some issues with the restful api add method. It always returns the status code 500. Here is some sample code ( in python ) to add a file as a pending change to a workspace: API_URL = 'http://localhost:9090/api/v1' workspace = "testWorkspace" path = "Assets/Shaders/NewSurfaceShader.shader" url = '%s/wkspaces/%s/content/%s' % ( API_URL , workspace , path ) paramsDict = { 'addPrivateParents' : True , 'checkoutParent' : True , 'recurse' : False } params = str( json.dumps( inParamsDict ) ) response = requests.post( url = url.strip() , data = params ) The url that is formed looks like this: http://localhost:9090/api/v1/wkspaces/testWorkspace/content/Assets/Shaders/NewSurfaceShader.shader The params dict is formatted as json like so: {"recurse": false, "checkoutParent": true, "addPrivateParents": true} I tried without passing the parameters, I have tried with just a directory instead of a file. I have also tried a PUT method, which does not fail, but the response of "affectedPaths" is an empty list. What could be going wrong here?