Forum Academy Marketplace Showcase Pricing Features

How to initialize a call with dynamic parameters in API Connector?

Hello,

I’m a bit confused on how to initialize a specific API call.

I’m integrating Frame.io into a client’s Bubble app. I’ve successfully created the developer token, set up the API and initialized a few calls. I’m struggling with creating a specific call which is to “Create an Asset”. I do not understand what to put in the dynamic parameters in the JSON body to initialize the call. Below is the API documentation.

https://developer.frame.io/api/reference/operation/createAsset/

  • I’ve already created the Developer token (Authoriziation key) and set it up using the Bearer value in the API connector.
  • I’ve already created the Team within Frame.io and acquired its TEAM ID.
  • I’ve already created a Project within Frame.io and acquired its PROJECT ID, thus acquiring its “Root Asset ID”. I’ve plugged these into the headers for the API call.

I need the user to upload a file, preferably an image, video or audio file, using a file uploader. When the “upload” button is clicked, the file(asset) will be uploaded both in bubble and to frame.io via the API post call.

Here are screen shots of what I have now. If someone can write down the examples for what to type in for these parameters, this will help me understand how this sorta of thing works.


Thank you

What error does this give you when you try to initialize it?

Also I believe the ‘file uploader A’s file’ value returns a truncated URL which will not be recognized. In my experience it returns something like “//s3.amazonaws.com/…”

In case that’s happening, you will have to add “https:” as a prefix to it so that it becomes a legit URL like “https://s3.amazonaws.com/…”

1 Like

Hello,

Thanks for replying. The error code I kept getting was 422 “invalid source”.

So in your example, if I had a file called “moonscape.mp4” would its url be “https://s3.amazonaws.com/moonscape.mp4”? Is that how I would enter it?

Thank you

Actually, I just tried that. It worked.

I completely rebuilt the API call and did not create any other dynamic parameters other than the source url. Simply adding what you told me allowed for the call to initialize.

I have to create other parameters but I think this specific field was the one that kept causing it to fail. Thank you very much.

1 Like

Glad I could help! :slight_smile:

1 Like

What would I do for fields like “Type”?

What am I entering here to indicate what type of file is being uploaded? In the API documentation for the example it just says “File”.

If I wanted the file being uploaded to be an image, video or audio file, what would I enter in this parameter?

Thank you

This seems to shed some light on the API details.
(At first the API documentation seemed to be really bad, but there is this resource too!)

1 Like

Ah! Gotcha.

Thank you.

1 Like

May I ask another question? What about multiple file types?

Do I just add a second line in the parameters? Like;

“file-type” = video/mp4
“file-type” = image/png

Or is there a way to add both file types on the same parameter?

Sorry for all the questions. I am still learning.

Thank you so much.

Looks like a single API call only accepts one file
So you’ll have to keep it to just one file type.

Multiple lines wouldn’t work, because it will take that entire value of
“file-type” = video/mp4
“file-type” = image/png
as a single string in the API call which the frameio server won’t understand

1 Like

Ah, very interesting.

This sucks, because I’d like for my users to be able to upload both images and videos. But the platform itself seems to specialize more in just videos, thus why its API probably only allows you to upload one type of file. Got it.

Thank you very much.