The Python SDK is a client class for our V3 API. It allows you to do GET, POST, PUT, PATCH and DELETE requests to our API by simply specifying the path to the and a (dictionary) parameter to represent the (JSON) data you want to send.
As a simple example to get those assets having the label 'Funny dogs', try these steps on the console:
- Go the folder where this file resides
$ cd python-v3-sdk
- Invoke the Python interpreter
$ python3
- Load the API module
>>> from api import OoyalaAPI
- Create an OoyalaAPI object by passing your V2 API keys:
>>> api = OoyalaAPI("<Your API Key>", "<Your Secret Key>")
- Get all assets having the "Funny dogs" label:
>>> parameters = {'where': "labels INCLUDES 'Funny dogs'"}
>>> assets = api.get('assets', parameters)['items']
- Now that we have our results on the assets array, lets print them embed codes and names
>>> for asset in assets:
print ("%s - %s" % (asset['embed_code'], asset['name']))
You can do much more that just querying for assets, type
>>> help(OoyalaAPI)
to get a complete documentation. Its that easy to work with this SDK!