Share API

/share

Description

Shares a blueprint or a script to users or user roles

URL structure

https://smart.cloud.com/v0/share?access_token=<valid access token>&objectId=<id of script/blueprint>&objectType=<Script/Process>&userIdString=<User ID in arrary>&roleString=<User roles in array>

URL example

https:// smart.cloud.com/v0/scripts/share?access_token=16C0UwkUWQQo6jmaJFLEqshpk&objectId=73417&objectType=SCRIPT&userIdString=18460&roleString=null

Method

POST

Parameters

Name Required or Optional Description
objectId Required ID of a script or blueprint that needs to be shared
objectType Required Shared object type that is a script or blueprint
userIdString Required, if rolestring is null Single or multiple user IDs separated by comma
roleString Required, if userIdString is null Single or multiple user roles separated by comma. For example: Admin; Architect

Response

JSON payload

Sample response:

{  
   "companyId":0,
   "extraAttrs":{  

   },
   "shareId":201,
   "objectId":73417,
   "objectType":"script",
   "details":[  
      {  
         "companyId":0,
         "extraAttrs":{  

         },
         "shareId":201,
         "sharedToUser":"18460",
         "shareMode":"READWRITE",
         "shareStatus":"Active"
      },
      {  
         "companyId":0,
         "extraAttrs":{  

         },
         "shareId":201,
         "sharedToRole":"null",
         "shareMode":"READWRITE",
         "shareStatus":"Active"
      }
   ],
   "createdByRole":"Admin",
   "createdByUser":"17892"
}

/unshare

Description

Unshare a blueprint or a script to users or user roles

URL structure

https://smart.cloud.com/v0/share?access_token=<valid access token>&objectId=<id of script/blueprint>&objectType=<Script/Process>&userIdString=<User ID in arrary>&roleString=<User roles in array>&shareId=<sharing task ID>

URL example

https:// smart.cloud.com/v0/scripts/share?access_token=2mfJYBNZLo9piEytdlsax2wOe&objectId=87937&objectType=SCRIPT&userIdString=null&roleString=null&shareId=224

Method

POST

Parameters

Name Required or Optional Description
objectID Required ID of a script or blueprint that needs to be shared.
objectType Required Shared object type that is a script or blueprint.
userIdString Required, if roleString is null Single or multiple user IDs separated by comma.
roleString Required, if userIdString is null Single or multiple user roles separated by comma. For example: Admin, Architect
shareId Required Sharing task ID.

Response

JSON payload

Sample response:

{  
   "companyId":0,
   "extraAttrs":{  

   },
   "shareId":224,
   "objectId":87937,
   "objectType":"script",
   "details":[  
      {  
         "companyId":0,
         "extraAttrs":{  

         },
         "shareId":224,
         "sharedToUser":"null",
         "shareMode":"READWRITE",
         "shareStatus":"Active"
      },
      {  
         "companyId":0,
         "extraAttrs":{  

         },
         "shareId":224,
         "sharedToRole":"null",
         "shareMode":"READWRITE",
         "shareStatus":"Active"
      }
   ],
   "createdByRole":"Admin",
   "createdByUser":"17892"
}

 

 

0 Comments