▶︎ 사용자 그룹 생성
1. Request URI
POST| https://서버 주소(ip)/api/3.4/sites/사이트 ID/groups
2. Request Body
<tsRequest>
<group name="그룹명" />
</tsRequest>
3. Response 결과
<tsResponse xmlns="http://tableau.com/api"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tableau.com/api
http://tableau.com/api/ts-api-3.4.xsd">
<group id="그룹 ID" name="그룹명" />
</tsResponse>
그룹 ID는 잘 메모해두는게 좋다.
▶︎ 사이트의 사용자 ID 가져오기
그룹에 사용자를 추가하기 위해서는 사용자 ID가 필요하기 때문에,
이를 가져오는 과정을 거쳐야 한다.
1. Request URI
GET| https://서버 주소(ip)/api/3.4/sites/사이트 ID/users
2. Response 결과
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.4.xsd">
<pagination pageNumber="1" pageSize="100" totalAvailable="9"/>
<users>
<user id="사용자 ID"
name="사용자명" siteRole="사용자 역할"
. . . more user metadata . . . />
<user id="사용자 ID"
name="사용자명" siteRole="사용자 역할"
. . . more user metadata . . . />
<!-- . . . more users . . . ->
</users>
</tsResponse>
▶︎ 그룹에 사용자 추가
1. Request URI
POST| https://서버 주소(ip)/api/3.4/sites/사이트 ID/groups/그룹 ID/users
2. Request Body
<tsRequest>
<user id="사용자 ID" />
</tsRequest>
3. Response 결과
<tsResponse xmlns="http://tableau.com/api"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.4.xsd">
<pagination pageNumber="1" pageSize="100" totalAvailable="1"/>
<user id="사용자 ID" name="사용자명"
siteRole="사용자 역할" authSetting="ServerDefault"
externalAuthUserId="외부 승인자 ID"/>
</tsResponse>
▶︎ 그룹에 권한 부여
1. Request URI
PUT| https://서버 주소(ip)/api/3.4/sites/사이트 ID/workbooks/워크북 ID/permissions
2. Request Body
<tsRequest>
<permissions>
<workbook id="워크북 ID" />
<granteeCapabilities>
<group id="그룹 ID" />
<capabilities>
<capability name="권한명" mode="허용여부" />
<!-- ... additional capabilities ... -->
</capabilities>
</granteeCapabilities>
</permissions>
</tsRequest>
3. Response 결과
<tsResponse xmlns="http://tableau.com/api"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-
api-3.4.xsd">
<permissions>
<workbook id="워크북 ID"
name="워크북명">
<owner id="owner id 정보"/>
</workbook>
<granteeCapabilities>
<group id="그룹 ID"/>
<capabilities>
<capability name="권한명" mode="허용여부"/>
<!— . . . other grantee capabilities . . . -->
</capabilities>
</granteeCapabilities>
</permissions>
</tsResponse>