Create a table link relationship
  • 01 Oct 2024
  • 2 Minutes to read
  • Contributors

Create a table link relationship


Article summary

Post
/tableLinks

Create a linking relationship by declaring the relationship type and creating a column in both the left and the right table. Note: these could be the same table.

Security
HTTP
Type basic

A Tulip API key is required to use the Tulip API. API key authentication uses HTTP Basic Authentication as defined by RFC 7617. HTTP Basic Authentication uses a generic username/password scheme to authenticate. For Tulip API requests, the password should be the API key's associated secret. The username should have the format {type}.{version}_{id}, where {type} is the API key type, {version} is the type's version number, and {id} is the id of the key. Tulip API keys currently are one of two types:

  • apikey.2 - user API keys provisioned by creating a Tulip API Token. The key id is the token id.
  • onetime.1 - temporary API keys provisioned using the /auth/temporary endpoint or using the One-Time API Key page. These keys are only valid for 30 seconds after provisioning.

Once you have determined the username and password you need to use, the Authorization header should be set to the value Basic {credentials}, where {credentials} is the base64-encoded value of the string {username}:{password}. See RFC 7617 for more details of this encoding.

Body parameters
object
leftTableId
string Required

Id of left table in link relationship

leftColumnLabel
string

Label to be used for the left column in linking relationship

rightTableId
string Required

Id of right table in link relationship

rightColumnLabel
string

Label to be used for the right column in linking relationship

relationshipType
string Required

The type of linking relationship

Valid values[ "one-to-one", "one-to-many", "many-to-one", "many-to-many" ]
Responses
201

link created successfully

object
Example{ "id": "gthSX9t3tY2cJfBWe", "createdAt": "2019-01-15T05:30:01Z", "createdBy": "N24uug8iXSTWR39rB", "updatedAt": "2019-01-15T05:31:20Z", "updatedBy": "N24uug8iXSTWR39rB", "leftTableId": "d3fbb2cf-f12a-4ebc-b054-c35085bea753", "leftTableColumnId": "the_left_column", "rightTableId": "227daca2-aea8-4482-9b8d-7d340b1ff34b", "rightTableColumnId": "the_right_column" }
id
string
Pattern^[a-zA-Z0-9_]+$
Exampleg56RCoZCtzv7borvp
createdAt
string (date-time)
createdBy
string
Pattern^[a-zA-Z0-9_]+$
Exampleg56RCoZCtzv7borvp
updatedAt
string (date-time)
updatedBy
string
Pattern^[a-zA-Z0-9_]+$
Exampleg56RCoZCtzv7borvp
deletedAt
string (date-time)
deletedBy
string
Pattern^[a-zA-Z0-9_]+$
Exampleg56RCoZCtzv7borvp
leftTableId
string

The ID of the left table in the link.

leftTableColumnId
string

The ID of the column in the left table that contains the links.

rightTableId
string

The ID of the right table in the link.

rightTableColumnId
string

The ID of the column in the right table that contains the links.

400

The request was malformed. This could mean that headers, query parameters, or the request body was unable to be parsed or had unexpected values.

object
errorCode
string
errorUniqueID
string
Pattern^[a-zA-Z0-9+/]+$
Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
details
string
401

The request was made unauthorized. HTTP Basic Authorization using a Tulip API Key is required for use of the API.

object
errorCode
string
errorUniqueID
string
Pattern^[a-zA-Z0-9+/]+$
Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
details
string
errorCode
Valid values[ "AuthenticationRequired" ]
403

The provided authentication info was rejected. The response will provide additional details.

object
errorCode
string
errorUniqueID
string
Pattern^[a-zA-Z0-9+/]+$
Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
details
string
errorCode
Valid values[ "AuthenticationFailed" ]
422

The request was malformed. This could mean that headers, query parameters, or the request body was unable to be parsed or had unexpected values.

object
errorCode
string
errorUniqueID
string
Pattern^[a-zA-Z0-9+/]+$
Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
details
string
500

The server encountered an unexpected error.

object
errorCode
string
errorUniqueID
string
Pattern^[a-zA-Z0-9+/]+$
Exampleaq21mSKC1rbO87TjC/4Hz2EJHd/v+jxf7MtC315vo0Y
details
string

Was this article helpful?