Send a Video File From Next.js for Processing Using Symbl AI Video Async API

Vladimir Novick
InstructorVladimir Novick
Share this video with your friends

Social Share Links

Send Tweet
Published 4 years ago
Updated 4 years ago

In this video lesson, you will learn how to send a video for processing to Symbl Async Video API. As a result you will get some parameters that you can use later on to retrieve insights about the video

Vladimir Novick: [0:00] Let's create Submit file for processing a function. This function will take a file, and we'll call Symbl API. We'll use video async API, go into api.symbl.ai/v1/process/video, and passing method as POST, and a bunch of headers.

[0:37] One important header to pass is x-api-key. Here, we need to post our token. A second header is Content-Type. Content-Type will be video/mp4. We'll also need to pass a body, which will be the file. We'll set JSON as true.

[1:03] Now, we need to bring our token. We can use useAuth hook for that. Let's bring this hook from our hooks/index.js. Whenever we receive a response from our Symbl API, we'll need to get rawResult and pass the JSON. Then we can log the JSON result.

[2:00] Let's see if it's working. Let's choose some test mp4 file. Click, Send and Processing. Within the Network tab, we'll see that video is sent. We can look at the headers. We'll see that our x-api-key is the actual token. The Console log, we'll see that we get back ConversationID and JobID.