1

I need to change the sharing properties of a document in Workfront (AtTask) and I need to make the change using the API.

Could you please provide me an example of how I could do a REST URL call to change the document's properties.

Basically, a document gets added to an existing project. I want the owner of the document to change to another user. Please assume that I have system administrator access level to do the change. But I need to do it using a URL Rest call.

Thanks

1 Answers1

0

You cannot change the owner of a document but you can grant someone manage access/ to do that you can make the following call.

GET /attask/api/v4.0/document/123abcxxxxxxxxxxxxxxxxxxxxxxxxxx/share?method=put&accessorID=abc123&accessorObjCode=USER&coreAction=DELETE 

to add a document with the access rule in place you could do the following.

POST /attask/api/document?updates={
name: aFileName,
handle: abc...123, (handle from the file upload)
docObjCode: PROJ, (or TASK, OPTASK, etc)
objID: abc...123,
accessRules: [
                 {accessorID: 'abc123', accessorObjCode: 'USER', coreAction: 'DELETE'},
                 {accessorID: 'abc345', accessorObjCode: 'USER', coreAction: 'VIEW'}
             ] 

}

You can set the owner ID by getting a sessionID by using your APIKey to get a sessionID for the owner.

POST /attask/api/v4.0/login?username={username of owner you want to set as}&apiKey={Your Admin Account APIKEY}

you will then use the sessionID to make the document POST of the document and it will be set as the user you got the sessionID for. This will only work with an apiKey and only a system admin account can do this.

michael johnson
  • 757
  • 1
  • 4
  • 10