Public api: Create link has 'data' argument#308
Open
Conversation
BigRoy
requested changes
Feb 25, 2026
Contributor
There was a problem hiding this comment.
I don't get the data returned from the link:
import ayon_api
import os
os.environ["AYON_SERVER_URL"] = "http://localhost:5000"
os.environ["AYON_API_KEY"] = "54f2c159eedc4b5fa10447571161e978"
project_name = "test"
folder_a = ayon_api.get_folder_by_path("test", "/apps/blender")
folder_b = ayon_api.get_folder_by_path("test", "/apps/maya")
link_type_name = "breakdown"
ayon_api.create_link(
project_name=project_name,
link_type_name=link_type_name,
input_id=folder_a["id"],
input_type="folder",
output_id=folder_b["id"],
output_type="folder",
link_name="MyLink",
data={"foo": "bar", "hello": "world"},
)
print(ayon_api.get_folder_links(
project_name,
folder_b["id"],
link_types=[link_type_name])
)
# This fails to work.[{'direction': 'in', 'linkType': 'breakdown', 'name': 'MyLink', 'description': 'breakdown link with input folder and output folder', 'entityType': 'folder', 'author': 'deadline', 'projectName': 'test', 'id': '64df3768129911f19082ee69ed383011', 'entityId': '0867b2404af211f0985a3b9388bc26af'}, {'direction': 'in', 'linkType': 'breakdown', 'name': 'MyLink', 'description': 'breakdown link with input folder and output folder', 'entityType': 'folder', 'author': 'deadline', 'projectName': 'test', 'id': 'ab7d5fec129911f19082ee69ed383011', 'entityId': '0867b2404af211f0985a3b9388bc26af'}, {'direction': 'in', 'linkType': 'breakdown', 'name': 'MyLink', 'description': 'breakdown link with input folder and output folder', 'entityType': 'folder', 'author': 'deadline', 'projectName': 'test', 'id': 'b2508236129911f19082ee69ed383011', 'entityId': '0867b2404af211f0985a3b9388bc26af'}, {'direction': 'in', 'linkType': 'breakdown', 'name': 'MyLink', 'description': 'breakdown link with input folder and output folder', 'entityType': 'folder', 'author': 'deadline', 'projectName': 'test', 'id': 'd5131b80129911f19082ee69ed383011', 'entityId': '0867b2404af211f0985a3b9388bc26af'}, {'direction': 'in', 'linkType': 'breakdown', 'name': 'MyLink', 'description': 'breakdown link with input folder and output folder', 'entityType': 'folder', 'author': 'deadline', 'projectName': 'test', 'id': 'dcfa442c129911f19082ee69ed383011', 'entityId': '0867b2404af211f0985a3b9388bc26af'}]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog Description
Public api function
create_linkdoes havedataargument now.Additional review information
Without this PR it is not possible to pass
datato public functioncreate_linkinstead developer has to get the connection object and call it on that.Testing notes:
datato publiccreate_linkfunction.