ユーザーのサービス利用規約のステータスを設定します。
true
ユーザーが利用規約に同意したかどうか。
ステータスを設定するサービス利用規約。
"1232132"
サービス利用規約のID
"terms_of_service"
オブジェクトのタイプ。
次の値に固定: terms_of_service
ステータスを設定するユーザー。
"3423423"
ユーザーのID
"user"
オブジェクトのタイプ。
次の値に固定: user
サービス利用規約ステータスオブジェクトを返します。
予期しないクライアントエラー。
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
}'
await client.termsOfServiceUserStatuses.createTermsOfServiceStatusForUser({
tos: new CreateTermsOfServiceStatusForUserRequestBodyTosField({ id: tos.id }),
user: new CreateTermsOfServiceStatusForUserRequestBodyUserField({
id: user.id,
}),
isAccepted: false,
} satisfies CreateTermsOfServiceStatusForUserRequestBody);
client.terms_of_service_user_statuses.create_terms_of_service_status_for_user(
CreateTermsOfServiceStatusForUserTos(id=tos.id),
CreateTermsOfServiceStatusForUserUser(id=user.id),
False,
)
await client.TermsOfServiceUserStatuses.CreateTermsOfServiceStatusForUserAsync(requestBody: new CreateTermsOfServiceStatusForUserRequestBody(tos: new CreateTermsOfServiceStatusForUserRequestBodyTosField(id: tos.Id), user: new CreateTermsOfServiceStatusForUserRequestBodyUserField(id: user.Id), isAccepted: false));
BoxTermsOfService.Info newUserStatus = BoxTermsOfServiceUserStatus.create(api, "tos-id", true, "user-id");
user = client.user(user_id='22222')
user_status = client.terms_of_service(tos_id='12345').set_user_status(is_accepted=True, user=user)
print(f'User status ID is {user_status.id} and the accepted status is {user_status.is_accepted}')
var createStatusRequest = new BoxTermsOfServiceUserStatusCreateRequest()
{
TermsOfService = new BoxRequestEntity()
{
Id = "11111",
Type = BoxType.terms_of_service
},
User = new BoxRequestEntity()
{
Id = "22222",
Type = BoxType.user
},
IsAccepted = true
};
BoxTermsOfServiceUserStatuses termsOfServiceUserStatuses =
await client.TermsOfServiceManager.CreateBoxTermsOfServiceUserStatusesAsync(createStatusRequest);
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' }
*/
});
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)")
}
{
"id": "11446498",
"type": "terms_of_service_user_status",
"created_at": "2012-12-12T10:53:43-08:00",
"is_accepted": true,
"modified_at": "2012-12-12T10:53:43-08:00",
"tos": {
"id": "11446498",
"type": "terms_of_service"
},
"user": {
"id": "11446498",
"type": "user",
"login": "ceo@example.com",
"name": "Aaron Levie"
}
}