Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,30 @@ See https://box-content.readme.io/#as-user-1 for more information about how this
# Same thing, but using file's as_user method
client.file(file_id='SOME_FILE_ID').as_user(user).rename('bar-2.txt')

Other Requests
~~~~~~~~~~~~~~

The Box API is continually evolving. As such, there are API endpoints available that are not specifically
supported by the SDK. You can still use these endpoints by using the ``make_request`` method of the ``Client``.

.. code-block:: python

# https://box-content.readme.io/reference#get-metadata-schema
from boxsdk.config import API
# Returns a Python dictionary containing the result of the API request
json_response = client.make_request(
'GET',
'{0}/metadata_templates/enterprise/customer/schema'.format(API.BASE_API_URL),
).json()

``make_request()`` takes two parameters:

- ``method`` -an HTTP verb like ``GET`` or ``POST``
- ``url`` - the URL of the requested API endpoint

``boxsdk.config.API`` is an object specifying which URLs to use in order to access the Box API. It can be used for
formatting the URLs to use with ``make_request``. Box objects also have a ``get_url`` method. Pass it an endpoint
to get the correct URL for use with that object and endpoint.

Box Developer Edition
---------------------
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def main():
install_requires.append('ordereddict>=1.1')
setup(
name='boxsdk',
version='1.4.1',
version='1.4.2',
description='Official Box Python SDK',
long_description=open(join(base_dir, 'README.rst')).read(),
author='Box',
Expand Down