指定した企業とユーザータイプに適用されるサービス利用規約を作成します。
"enabled"
このサービス利用規約がアクティブであるかどうか。
次の値のいずれか1つ: enabled
,disabled
"By collaborating on this file you are accepting..."
ユーザーに対して表示されるサービス利用規約のテキスト。
status
がdisabled
に設定されている場合は、テキストを空に設定できます。
"managed"
サービス利用規約を設定するユーザーのタイプ。
次の値のいずれか1つ: external
,managed
curl -i -X POST "https://api.box.com/2.0/terms_of_services" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"status": "enabled",
"text": "By collaborating on this file you are accepting..."
}'
var tosParams = new CreateTermsOfServicesAsync()
{
Status = "enabled"
TosType = "external",
Text = "By using this service, you agree to ..."
};
BoxTermsOfService tos = await client.TermsOfServiceManager.CreateTermsOfServicesAsync(tosParams);
BoxTermsOfService.Info newTOS = BoxTermsOfService.create(
api,
BoxTermsOfService.TermsOfServiceStatus.ENABLED,
BoxTermsOfService.TermsOfServiceType.EXTERNAL,
"Terms of Service..."
);
from boxsdk.object.terms_of_service import TermsOfServiceType, TermsOfServiceStatus
terms_of_service = client.create_terms_of_service(TermsOfServiceStatus.ENABLED,TermsOfServiceType.MANAGED, 'Example Text')
print(f'Terms of Service status is {terms_of_service.status} and the message is {terms_of_service.text}')
client.termsOfService.create('managed', 'enabled', 'By using this service, you agree to ...')
.then(tos => {
/* tos -> {
type: 'terms_of_service',
id: '12345',
status: 'enabled',
enterprise: { type: 'enterprise', id: '55555' },
tos_type: 'managed',
text: 'By using this service, you agree to ...',
created_at: '2018-04-19T13:55:09-07:00',
modified_at: '2018-04-19T13:55:09-07:00' }
*/
});
client.termsOfService.create(
status: .enabled,
tosType: .managed,
text: "Test Terms of Service"
) { (result: Result<TermsOfService, BoxSDKError>) in
guard case let .success(termsOfService) = result else {
print("Error creating terms of service")
return
}
print("Terms of Service with id: \(termsOfService.id) was created")
}
{
"id": "11446498",
"type": "task",
"action": "review",
"completion_rule": "all_assignees",
"created_at": "2012-12-12T10:53:43-08:00",
"created_by": {
"id": "11446498",
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
},
"due_at": "2012-12-12T10:53:43-08:00",
"is_completed": true,
"item": {
"id": "12345",
"type": "file",
"etag": "1",
"file_version": {
"id": "12345",
"type": "file_version",
"sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
},
"name": "Contract.pdf",
"sequence_id": "3",
"sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37"
},
"message": "Legal review",
"task_assignment_collection": {
"entries": [
{
"id": "11446498",
"type": "task_assignment",
"item": {
"id": "12345",
"etag": "1",
"type": "file",
"sequence_id": "3",
"name": "Contract.pdf",
"sha1": "85136C79CBF9FE36BB9D05D0639C70C265C18D37",
"file_version": {
"id": "12345",
"type": "file_version",
"sha1": "134b65991ed521fcfe4724b7d814ab8ded5185dc"
}
},
"assigned_to": {
"id": "11446498",
"type": "user",
"name": "Aaron Levie",
"login": "ceo@example.com"
},
"message": "Please review",
"completed_at": "2012-12-12T10:53:43-08:00",
"assigned_at": "2012-12-12T10:53:43-08:00",
"reminded_at": "2012-12-12T10:53:43-08:00",
"resolution_state": "incomplete",
"assigned_by": {
"id": "11446498",
"type": "user",
"name": "Aaron Levie",
"login": "ceo@example.com"
}
}
],
"total_count": 100
}
}