How to POST request with video?

SOLVE
Highlighted
New Contributor

I have a table in which there is a video column. In the documentation it doesn't explain how to POST a new record including a video. Can someone explain how please?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
HubSpot Moderator

Hi, @Suonpera.

 

Apologies for the delayed response.

 

To confirm, are you using a HubL video player module?

 

The HubL statement takes a player_id which, per this documentationcan be retrieved with a GET to /filemanager/api/v2/files/:file_id in the meta.video_data.hosting_infos dictionary, but I have been able to get it to work with the file ID alone.

 

If neither of these IDs are working for you, could you share a link to the page where you are trying to get these videos to display? Feel free to share it with me via direct message.

Isaac Takushi

HubSpot Developer Support
Reply
0 Upvotes
7 Replies 7
Highlighted
HubSpot Moderator

Welcome, @Suonpera.

 

When you upload the video file to your account's file manager, the API will respond with the file's id.

 

You can then use this id as an integer when updating a HubDB row.

 

Here's an example payload. Column 3 has the"type": "VIDEO".

{
  "values": {
    "2": "My First Video",
    "13": 6783618473
  }
}

Isaac Takushi

HubSpot Developer Support
Reply
0 Upvotes
New Contributor

The API is now accepting my POST request using the file id. However, the video still isn't being uploaded to the HubDB. A loading icon is displayed. My first thought was that it can take a while to upload the video, but I am trying with a video that is only 11 sec long and I have been waiting for 10 minutes.

 

This is in the body of the request:

{
	"values": 
		{
			"6": "Test title",
			"7": "Duration",
			"10":[ {
			  "id": 24402073174,
			  "name": 169554,
			  "type": "foreignId"
			}],
			"11": 24406370439
		}
}

column 11 is the video column

Reply
0 Upvotes
Highlighted
New Contributor

UPDATE

I was using the file id that I found in the file details of the video. However, this is apparently incorrect, which is why it was not working. Why is that not the correct id? I can only get the correct Id, if I inspect the 'upload video to files' request.

Reply
0 Upvotes
Highlighted
New Contributor

Hey Isaac. This didn't solve my solution. I am able to upload yes, but why is the file ID wrong, when I find the video in the file archive? My Team (not developers) need an easy way to get the ID of the uploaded video.

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hi, @Suonpera.

 

Apologies for the delayed response.

 

To confirm, are you using a HubL video player module?

 

The HubL statement takes a player_id which, per this documentationcan be retrieved with a GET to /filemanager/api/v2/files/:file_id in the meta.video_data.hosting_infos dictionary, but I have been able to get it to work with the file ID alone.

 

If neither of these IDs are working for you, could you share a link to the page where you are trying to get these videos to display? Feel free to share it with me via direct message.

Isaac Takushi

HubSpot Developer Support
Reply
0 Upvotes
Highlighted
New Contributor

Actually I wasn't aware that I needed to use file id to fetch another id. I though I could use the file Id. Well that sorts everything out. Thanks for your help!

Reply
0 Upvotes
Highlighted
HubSpot Moderator

Hi, @Suonpera.

 

Actually I was trying to say that the file ID alone did work for me!

 

Either way, it sounds like you found a solution, though, so I'm glad.

Isaac Takushi

HubSpot Developer Support
Reply
0 Upvotes