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:
I updated our dev console app to the latest
I have beta features enabled
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
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.
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 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?