Skip to content

Commit 90e57f6

Browse files
authored
Merge pull request #67 from seatable/add-link-records-api
Update main.py
2 parents 6e417d2 + 94bbfe1 commit 90e57f6

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

seatable_api/main.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ def _third_party_accounts_url(self):
162162
def _dtable_db_query_url(self):
163163
return self.dtable_db_url + '/api/v1/query/' + self.dtable_uuid + '/'
164164

165+
def _dtable_db_linked_records_url(self):
166+
return self.dtable_db_url + '/api/v1/linked-records/' + self.dtable_uuid + '/'
167+
165168
def _get_related_users_url(self):
166169
return '%(server_url)s/api/v2.1/dtables/%(dtable_uuid)s/related-users/' % {
167170
'server_url': self.server_url,
@@ -502,6 +505,21 @@ def batch_update_links(self, link_id, table_id, other_table_id, row_id_list, oth
502505
response = requests.put(url, json=json_data, headers=self.headers, timeout=self.timeout)
503506
return parse_response(response)
504507

508+
def get_linked_records(self, table_id, link_column_key, rows):
509+
"""
510+
:param table_id: str
511+
:param link_column_key: str
512+
:param rows: list
513+
"""
514+
url = self._dtable_db_linked_records_url()
515+
json_data = {
516+
'table_id': table_id,
517+
'link_column': link_column_key,
518+
'rows': rows,
519+
}
520+
response = requests.post(url, json=json_data, headers=self.headers, timeout=self.timeout)
521+
return parse_response(response)
522+
505523
def list_columns(self, table_name, view_name=None):
506524
"""
507525
:param table_name: str

0 commit comments

Comments
 (0)