Skip to main content
Question

Cannot get representation of

  • May 22, 2025
  • 3 replies
  • 34 views

Forum|alt.badge.img

I am having issues getting a mp4 representation of the mp4 file I have uploaded. 

 

I get the list of the representations, I then generate a curl url as an example, and I receive the error:

{"type":"error","status":404,"code":"not_found","help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Files of type 'mp4' do not support this representation.","request_id":"h9v1qjfpy7ui15ks"}%

Which seems off because the representation that I am getting is:

      %{"info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/mp4"},
        "properties" => %{}, "representation" => "mp4"},

And it is showing that it is properly a mp4 success representation:

 %{"content" => %{"url_template" => "https://dl.boxcloud.com/api/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/mp4/content/{+asset_path}"},
   "info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/mp4"},
   "properties" => %{}, "representation" => "mp4",
   "status" => %{"state" => "success"}},

I would feel like this would be a bug, but I would want to err on the side of caution. 

more verbose logs:

%Tesla.Env{__client__: %Tesla.Client{fun: nil, post: [],
  pre: [{Tesla.Middleware.Headers, :call,
    [%{"Authorization" => "Bearer REDACTED"}]}]},
 __module__: Box.BoxClient,
 body: %{"etag" => "1", "id" => "26***phone number removed for privacy***",
   "representations" => %{"entries" => [%{"info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/jpg_thumb_32x32"},
        "properties" => %{"dimensions" => "32x32", "paged" => "false",
          "thumb" => "true"}, "representation" => "jpg"},
      %{"info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/jpg_thumb_94x94"},
        "properties" => %{"dimensions" => "94x94", "paged" => "false",
          "thumb" => "true"}, "representation" => "jpg"},
      %{"info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/jpg_160x160"},
        "properties" => %{"dimensions" => "160x160", "paged" => "false",
          "thumb" => "false"}, "representation" => "jpg"},
      %{"info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/jpg_320x320"},
        "properties" => %{"dimensions" => "320x320", "paged" => "false",
          "thumb" => "false"}, "representation" => "jpg"},
      %{"info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/jpg_1024x1024"},
        "properties" => %{"dimensions" => "1024x1024", "paged" => "false",
          "thumb" => "false"}, "representation" => "jpg"},
      %{"info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/mp4"},
        "properties" => %{}, "representation" => "mp4"},
      %{"info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/dash"},
        "properties" => %{}, "representation" => "dash"},
      %{"info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/filmstrip"},
        "properties" => %{}, "representation" => "filmstrip"}]},
   "type" => "file"},
 headers: %{"age" => "0", "box-request-id" => "03v99dr723mvbjvkltlho4giki5",
   "cache-control" => "no-cache, no-store", "connection" => "keep-alive",
   "content-length" => "1696", "content-type" => "application/json",
   "date" => "Mon, 02 Apr 2018 04:49:27 GMT", "etag" => "\"1\"",
   "strict-transport-security" => "max-age=31536000",
   "vary" => "Accept-Encoding"}, method: :get, opts: [],
 query: [fields: "representations"], status: 200,
 url: "https://api.box.com/2.0/files/26***phone number removed for privacy***"}
%Tesla.Env{__client__: %Tesla.Client{fun: nil, post: [],
  pre: [{Tesla.Middleware.Headers, :call,
    [%{"Authorization" => "Bearer REDACTED"}]}]},
 __module__: Box.BoxClient,
 body: %{"content" => %{"url_template" => "https://dl.boxcloud.com/api/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/mp4/content/{+asset_path}"},
   "info" => %{"url" => "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/mp4"},
   "properties" => %{}, "representation" => "mp4",
   "status" => %{"state" => "success"}},
 headers: %{"age" => "0", "cache-control" => "no-cache, no-store",
   "connection" => "keep-alive", "content-length" => "354",
   "content-type" => "application/json",
   "date" => "Mon, 02 Apr 2018 04:49:27 GMT",
   "strict-transport-security" => "max-age=31536000",
   "vary" => "Accept-Encoding"}, method: :get, opts: [], query: [], status: 200,
 url: "https://api.box.com/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/mp4"}
"https://dl.boxcloud.com/api/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/mp4/content/1.mp4"
curl -X GET "https://dl.boxcloud.com/api/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/mp4/content/1.mp4"  -H "Authorization: Bearer REDACTED"


curl -X GET "https://dl.boxcloud.com/api/2.0/internal_files/26***phone number removed for privacy***/versions/***number removed for privacy***887/representations/mp4/content/1.mp4"  -H "Authorization: Bearer REDACTED"
{"type":"error","status":404,"code":"not_found","help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Files of type 'mp4' do not support this representation.","request_id":"h9v1qjfpy7ui15ks"}%

3 replies

Forum|alt.badge.img

 It looks like you're replacing the {+asset_path} in the content URL template with 1.mp4 — for MP4 representations you should actually replace it with the empty string (""), so the URL just ends with /content/ — can you try that and let me know if it works for you?


Forum|alt.badge.img

Looks like that did it! yay. 

 

according to the docs it is confusing as are the samples since the pdf embeds work different, https://developer.box.com/v2.0/reference#fetching-a-pdf-representation

Do you know how to specify which resolution for the mp4 representation to get?

 


Forum|alt.badge.img

 Unfortunately, there is no way to specify the resolution of the MP4 representation — there is only one resolution generated for previewing.