APIs & Integrations

Suonpera
Miembro

How to POST request with video?

resolver

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?

0 Me gusta
1 Soluciones aceptada
IsaacTakushi
Solución
HubSpot Employee
HubSpot Employee

How to POST request with video?

resolver

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

Associate Certification Manager

Ver la solución en mensaje original publicado

0 Me gusta
7 Respuestas 7
IsaacTakushi
HubSpot Employee
HubSpot Employee

How to POST request with video?

resolver

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

Associate Certification Manager
0 Me gusta
Suonpera
Miembro

How to POST request with video?

resolver

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.

0 Me gusta
IsaacTakushi
Solución
HubSpot Employee
HubSpot Employee

How to POST request with video?

resolver

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

Associate Certification Manager
0 Me gusta
Suonpera
Miembro

How to POST request with video?

resolver

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!

0 Me gusta
IsaacTakushi
HubSpot Employee
HubSpot Employee

How to POST request with video?

resolver

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

Associate Certification Manager
0 Me gusta
Suonpera
Miembro

How to POST request with video?

resolver

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

0 Me gusta
Suonpera
Miembro

How to POST request with video?

resolver

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.

0 Me gusta