Search the Community
Showing results for tags 'rest api'.
-
Hi, When using Plastic SCM GUI, a item removed locally (a deleted file) appears in the "Pending Changes" section and this change can be checkin. I cannot figure out how to to replicate this using the REST API, i.e I would like to checkin a file deletion. I tried setting the `paths` parameter to the path of the deleted file or of the directory where the deleted file was located. url = __api_url + f"/wkspaces/myworkspace/checkin" params = { "paths": [ "wkpath/to/file" # also tried "wkpath/to/file_dir" ], "comment": "Deleting a file", "recurse": True, } res = requests.post( url, headers={ "Content-type": "application/json", "Accept": "application/json", }, data=json.dumps(params), ) print(res.json()) # will print: {'totalSize': 0, 'transferredSize': 0, 'status': 'Checkin operation starting...'} And the response returned by a GET at "api/v1/wkspaces/myworkspace/checkin" is: {"status":"Failed", "message":"There are no changes in the workspace c:\\Users\\Baptiste\\wkspaces\\myworkspace"} What am I missing? How do you submit a file deletion when using the REST API? Thank you!
-
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?