新規ユーザーの利用規約ステータスを作成

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

ユーザーの利用規約のステータスを設定します。

Request

Bearer [ACCESS_TOKEN]
application/json

Request Body

booleanin bodyrequired
true

ユーザーが利用規約に同意したかどうか。

objectin body

ステータスを設定する利用規約。

stringin bodyrequired
1232132

利用規約のID

stringin bodyrequired
terms_of_service

Value is always terms_of_service

objectin body

ステータスを設定するユーザー。

stringin bodyrequired
3423423

ユーザーのID

stringin bodyrequired
user

Value is always user

Response

利用規約ステータスオブジェクトを返します。

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

post
新規ユーザーの利用規約ステータスを作成
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X POST "https://api.box.com/2.0/terms_of_service_user_statuses" \
     -H "Authorization: Bearer <ACCESS_TOKEN>" \
     -H "Content-Type: application/json" \
     -d '{
       "tos": {
         "type": "terms_of_service",
         "id": "1232132"
       },
       "user": {
         "type": "user",
         "id": "3423423"
       },
       "is_accepted": true
     }'
Java
BoxTermsOfService.Info newUserStatus = BoxTermsOfServiceUserStatus.create(api, "tos-id", true, "user-id");
Python
user = client.user(user_id='22222')
user_status = client.terms_of_service(tos_id='12345').set_user_status(is_accepted=True, user=user)
print('User status ID is {0} and the accepted status is {1}'.format(user_status.id, user_status.is_accepted)
Node
client.termsOfService.createUserStatus('11111', true, {user_id: '22222'})
	.then(tosStatus => {
		/* tosStatus -> {
			type: 'terms_of_service_user_status',
			id: '12345',
			tos: { type: 'terms_of_service', id: '11111' },
			user: { type: 'user', id: '22222' },
			is_accepted: true,
			created_at: '2018-04-11T15:33:49-07:00',
			modified_at: '2018-04-11T15:33:49-07:00' }
		*/
	});
iOS
client.termsOfService.createUserStatus(
    tosId: "12345",
    isAccepted: true,
    userId: "54321"
) { (result: Result<TermsOfServiceUserStatus, BoxSDKError>) in
    guard case let .success(userStatus) = result else {
        print("Error accepting Terms of Service for new user")
        return
    }

    print("User status for accepting of Terms of Service is \(userStatus.isAccepted)")
}

Response Example

{
  "type": "error",
  "code": "item_name_invalid",
  "help_url": "http://developers.box.com/docs/#errors",
  "message": "Method Not Allowed",
  "request_id": "abcdef123456",
  "status": 400
}