Best answer

How do I return video metadata from Dropbox file using a webhook?

  • 10 November 2022
  • 4 replies
  • 100 views

Userlevel 1
Badge

Hey there,

 

I’m looking to run a webhook call to the Dropbox API to return some video metadata, which is possible through the “get_metadata” call found here:

https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata

 

I understand getting the basic info, which I’ve got working, but I’m very green about API calls through webhooks.

 

I’m just looking to pull metadata for a video, but I’m not exactly sure how the “data” fields in the webhook would need to be set up since when you set “include_media_info” to “true” it seems the call is looking for another parameter or a different data input which I can’t figure out from the docs. I get an error that says “true is not a valid boolean.” I tried creating a new key/value pair with “FileMetadata.media_info” set to “video” like the docs maybe suggested(?) but I get a different error “FileMetadata.media_info not a valid field.”

 

Would anyone be willing to help? What am I missing?

 

Thanks!

 

icon

Best answer by sillywonka 17 November 2022, 03:12

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 7
Badge +14

Hi @sillywonka 

Good question.

You can use the Webhooks app as an action step:

Try using a Custom POST request.

 

URL goes in the URL field.

 

Headers go in the Headers section.

 

Parameters go in the Data section. (copy the JSON Code)

 

 

Then post a screenshot with how your Webhook step is configured if you are still having trouble so we have enough context.

 

Userlevel 1
Badge

@Troy Tessalone Hello again! Sorry to bug you.

 

So my current Zap configuration looks like this:

 

 

So I’ve got this working where it returns the basic metadata info for the file if I remove the “FileMetadata.media_info” key/value pair and set the “include_media_info” to false.

 

I’m tripped up where the Dropbox docs specify that if the “include_media_info” is set to true, then   “FileMetadata.media_info is set for photo and video,” Which I thought was what I was doing here, but maybe I don’t understand how that should be passed.

 

Thanks for any and all help!

Userlevel 7
Badge +14

@sillywonka 

Looks like there are extra spaces after “path” and before “/delivery...”

 

Userlevel 1
Badge

@Troy Tessalone Sadly, that was not the issue. The image I uploaded was edited, so it looks like there’s more space than there is. I omitted the beginning of the file path for security. 

 

However, I got the answer by trial and error:

 

I used the webhook as a Custom Request instead and used the example JSON in the “data” field directly copied from the Dropbox API docs and then modified to fit. Here’s what that looks like:

 

 

Thanks for your help though!