利用規約を作成

post
https://api.box.com/2.0
/terms_of_services

指定した会社とユーザータイプに適用される利用規約を作成します。

リクエスト

application/json

リクエスト本文

string本文内必須
enabled

この利用規約がアクティブであるかどうか。

次の値のいずれか1つ: enabled,disabled

string本文内必須
By collaborating on this file you are accepting...

ユーザーに対して表示される利用規約テキスト。

statusdisabledに設定されている場合は、テキストを空に設定できます。

string本文内省略可能
managed

利用規約を設定するユーザーのタイプ。

次の値のいずれか1つ: external,managed

レスポンス

application/jsonTask

新しいタスクオブジェクトを返します

予期しないクライアントエラー。

post
利用規約を作成
このドキュメント内で一部のAPIを試せるようになりました。
ログイン

リクエストの例

cURL
curl -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..."
     }'
.NET
var tosParams = new CreateTermsOfServicesAsync()
{
    Status = "enabled"
    TosType = "external",
    Text = "By using this service, you agree to ..."
};
BoxTermsOfService tos = await client.TermsOfServiceManager.CreateTermsOfServicesAsync(tosParams);
Java
BoxTermsOfService.Info newTOS = BoxTermsOfService.create(
    api,
    BoxTermsOfService.TermsOfServiceStatus.ENABLED,
    BoxTermsOfService.TermsOfServiceType.EXTERNAL,
    "Terms of Service..."
);
Python
from boxsdk.object.terms_of_service import TermsOfServiceType, TermsOfServiceStatus
terms_of_service = client.create_terms_of_service(TermsOfServiceStatus.ENABLED,TermsOfServiceType.MANAGED, 'Example Text')
print('Terms of Service status is {0} and the message is {1}'.format(terms_of_service.status, terms_of_service.text))
Node
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' }
		*/
	});
iOS
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")
}