Upload Media Beta Feature - 404

I’m trying to use the new feature to Upload Media via the Typescript SDK. Im getting a 404 when I call the function.

I have:

  1. I updated our dev console app to the latest
  2. I have beta features enabled
  3. I call createMediaReference as shows in the documentation
    But i get a 404.

Screenshots for the described an my code are attached.
Note this is a React app and the source of the file is upload via the browser. In JS, File inherits Blob and I am passing the File object thru

Appreciate some assistance. Thank you




Hey, could you include the API Name of the object you are trying to upload to and the properties associated to it so we can confirm the usage is correct?

You can find this information in Ontology Management App by looking at the object type.

Hi jeg

Its UploadedMediaObject and it has property media_item which is a MediaReference.

That said, I understood that its a 2 step process. First step is to call the generic upload API as shown above. Second step to create my object using the ref. I don’t get to the second step bc the first 404s.

createMediaReference behind the scenes, adds the media item to the mediaSet that’s backing the mediaReference property of the specified object type and then returns the corresponding mediaReference.

You can then pass that mediaReference to an action to either create new objects or potentially do some transformations on top of the media item.

In your case, can you try setting objectTypeApi: “UploadedMediaObject” and propertyTypeApi: “media_item” of your createMediaReference method?

I have tried this but I still get a 404. I guess if that was the problem I would have gotten a 400 anyway. Any other ideas?

Any chance your mediaReference property in the object type is backed by multiple mediasets?

no, is there something i can provide to progress this?

I update my sdk version (2.2.0-beta.3) yesterday and noticed the function changed. I see the parameters objectType and propertyType now. So i updated my code and tried it. Now instead of a 404 I get a 400 error. How do i find out what’s wrong from that response?

Thx



Hi! So if the name of your mediaReference property is mediaItem can you try setting propertyType: mediaItem?

This is the typescript that I see in VS Code.

propertyType is FilteredPropertyKeys<Q, “mediaReference”>

mediaReference is the only term that compiles successfully.