Jump to content

new ftrack_api


Tilt

Recommended Posts

Posted

Hi,

 

I've read on the migration and release notes page that there's a new API in beta. It seems to change things quite a bit, with session objects? Could you please elaborate a bit about that development? Basically I just want to make sure that our custom stuff continues to work when we get upgraded to 3.1 (currently on 3.0.29.4283)

 

It's hard to keep up with the api docs because I get lost a lot in there... the new ftrack_api package seems to follow a different version numbering scheme. And links from the release notes seem to end up on pages that I have a hard time finding again using the hierarchy on the left... :-)

Posted

Hi,

 

When upgrading to 3.1.x you'll need to upgrade your ftrack API to the latest version for your custom integration to work. You'll only need to update the package, you don't need to change anything in the script itself.

 

The API that currently is in beta is out new API which is completely rewritten from the ground up and will be released soon. The old API will still function and receive updates and you can choose to move over when it suits you. To read more about the new API visit this page: http://ftrack-python-api.rtd.ftrack.com/en/latest/

 

Regards,

Carl

  • 2 weeks later...
Posted

Was about to play with the new api but not sure it works as it should? Maybe it's so early that we shouldn't be able to use it? Trying with a simple script with my user which have api rights.

import ftrack_apisession = ftrack_api.Session(	server_url='https://youerserver.ftrackapp.com',	api_key='1337-your-key',	api_user='youruser')projects = session.query('Project')for project in projects:    print project['name']

I just get this:

neo@NEO-rMBP|/Library/Python/2.7/site-packages/ftrack_api: python ~/Documents/ftrack_dev/test_connect.py /Library/Python/2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.'>https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.  InsecurePlatformWarning/Library/Python/2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.'>https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.  InsecurePlatformWarning/Library/Python/2.7/site-packages/requests/packages/urllib3/connectionpool.py:768: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html  InsecureRequestWarning)Traceback (most recent call last):  File "/Users/neo/Documents/ftrack_dev/test_connect.py", line 24, in <module>    for project in projects:  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py", line 581, in __iter__    v = self[i]  File "/Library/Python/2.7/site-packages/ftrack_api/query.py", line 22, in __getitem__    self._fetch_results()  File "/Library/Python/2.7/site-packages/ftrack_api/query.py", line 35, in _fetch_results    self._results = self._session._query(self._expression)  File "/Library/Python/2.7/site-packages/ftrack_api/session.py", line 519, in _query    results = self._call(batch)  File "/Library/Python/2.7/site-packages/ftrack_api/session.py", line 1230, in _call    result['content']ftrack_api.exception.ServerError: Server reported error Exception(Python API is disabled and cannot be used. Please ask your system administrator to enable it in the ftrack.ini file.)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...