API rejecting valid rbxm/rbxmx models

Hello, I’m making an application that updates a specific model, using the assets/v1/assets/{assetId} endpoint. I’m sending the correctly encoded (it can be imported into studio) bytes of either an rbxm or rbxmx file over fileContent:

let url = format!("{API_HEAD}assets/v1/assets/{}", params.asset_id);
let form = Form::new()
    .part("request", Part::text(meta.to_string()))
    .part(
         "fileContent",
          Part::bytes(payload.0.into_vec()).file_name("model.rbxm"),
    );

I’m using the rbx_binary and rbx_xml crates to encode rbxm and rbxmx files respectively.

This initial patch request succeeds, however polling the operation using the assets/v1/operations/{operationId} endpoint later fails:

{
  "path": REDACTED,
  "operationId": REDACTED,
  "done": true,
  "error": {
    "code": "Unknown",
    "message": "Failed to parse the uploaded file",
    "details": []
  }
}

(Sorry for the redcations, they’re just standard operationIds)

I’ve heard somewhere that the API does not accept models that were created outside studio, if so, why? And what can I do about it?

you need to include type in your request

https://create.roblox.com/docs/en-us/cloud/guides/usage-assets#supported-asset-types-and-limits


1 Like

Adding model/x-rbxm as MIME worked, thank you. I’m not sure on how I missed this part

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.