How to keep both apis running at the same time
2 2

3 posts in this topic

Hello. as you  suggested, I am trying the new api.I read that its possible to keep both

apis running at the same time and I tried a little exercise:

I queried a sequence  using both apis and I got this result:

1.PNG.a91636a4f661be2ba8906e86385e5fdd.P

the first line its the result using the old api and the last one ,using the last one.

Then,I tried to create a folder:

both.PNG.779fbe93a0045e95adf3ecd72b25ac2

 

if  in "session.create" in "parent " I use "sequence01" it works fine but If I use  "sequence" I got an error ,so I would appreciate If  anyone could tell me what do I need  to  make it work.

 

Greetings and sorry If I am asking too many questions.

 

 

 

Share this post


Link to post
Share on other sites

"sequence" is the old apis object, and "sequence01" is the new apis object. You can't mix objects between the apis.

If you are using the new api for creating you will need "sequence01". As for your example you are better off getting the id of an object in the old api, and then get the new apis object by querying the id (I haven't tested the below code):

old_sequence = ftrack.getSequence(["createcondorito", "test"])

new_sequence = session.query('Sequence where id is "%s"' % old_sequence.getId())

session.create("Folder", {"name": "testFolder", "parent": new_sequence})

session.commit()

Hope that helps :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
2 2