Manage Applications

    Create terms of service

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

    Creates a terms of service for a given enterprise and type of user.

    Request

    application/json

    Request Body

    stringin bodyrequired
    enabled

    Whether this terms of service is active.

    Value is one of "enabled", "disabled"

    stringin bodyrequired
    By collaborating on this file you are accepting...

    The terms of service text to display to users.

    The text can be set to empty if the status is set to disabled.

    stringin bodyoptional
    managed

    The type of user to set the terms of service for.

    Value is one of "external", "managed"

    Response

    application/jsonTask

    Returns a new task object

    You can now try out some of our APIs live, right here in the documentation.
    Log In

    Request Example

    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' }
    		*/
    	});

    Response Example

    {
      "id": 11446498,
      "type": "task",
      "item": {
        "id": 12345,
        "etag": 1,
        "type": "file",
        "sequence_id": 3,
        "name": "Contract.pdf"
      },
      "due_at": "2012-12-12T10:53:43-08:00",
      "action": "review",
      "message": "Legal review",
      "task_assignment_collection": {
        "total_count": 5000,
        "limit": 1000,
        "offset": 2000,
        "order": [
          {
            "by": "type",
            "direction": "ASC"
          }
        ],
        "entries": [
          {
            "id": 11446498,
            "type": "task_assignment",
            "item": {
              "id": 12345,
              "etag": 1,
              "type": "file",
              "sequence_id": 3,
              "name": "Contract.pdf"
            },
            "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"
            }
          }
        ]
      },
      "is_completed": true,
      "created_by": {
        "id": 11446498,
        "type": "user",
        "name": "Aaron Levie",
        "login": "ceo@example.com"
      },
      "created_at": "2012-12-12T10:53:43-08:00",
      "completion_rule": "all_assignees"
    }