HubDB API - Add Row With Foreign Key

Hi,

I have been working quite alot in implementing Hubspots API in sending data to my HubDB tables. I have come across an issue where one of my table fields is a Foreign Key.

I can’t find anywhere in the documentation what the value type is for the response when sending it to the API. The Create row endpoint list all field types minus a Foreign key: https://legacydocs.hubspot.com/docs/methods/hubdb/v2/create_row

Is this something the API cannot do? If it can, I would be grateful for an example.

Hello @SirHubalot

I believe the question @DavidFJones asked is what you are also asking. @WendyGoh provided an answer.

Hi dennisedson.

That was one of the first posts I saw but that didn’t help me. But I managed to find the solution. All I needed to do was to send over my foreign keys to my table column in the following JSON Structure:

[
 {
	id: 123456789,
	type: "foreignid"
 },
 {
	id: 988765434,
	type: "foreignid"
 },
 {
	id: 4645645644,
	type: "foreignid"
 }
]

I’d be interested to know if you had the same issue as I have when inserting a foreign id via API

https://community.hubspot.com/t5/APIs-Integrations/HUBDB-foreign-ID-insertion-via-API-doesn-t-work/m-p/816774#M65489