API REST Method: embed
Get the known embed code for a video by its source url (url), Magma video id (id), or Magma instance id (instance_id).
(Note: The info method can return information for an instance or a video. To learn more about how we categorize videos and instances, please read this page.)
URL
http://mag.ma/embed.format
Formats
XML, JSON, YAML, HTML, JS, text
HTTP Method
GET
Authentication
none
Rate Limited
none
Parameters
(Either id, url, or instance_id must be specified.)
- id. Required. : Magma video identification number
- Example: http://mag.ma/420278
- url. Required. : Video source URL.
- Example: http://vimeo.com/9749744
- instance_id. Required. : Magma instance identification number.
- This number is the id given inside the <instance> block. When instance_id is specified, information will always be returned as information for that single instance and not the Magma video.
- callback. Optional. Specify a function callback (JSON format only)
Response
JSON Example:
{ "embed": "
<obj ect width=\"400\" height=\"225\">
<param name=\"allowfullscreen\" value=\"true\" />
<param name=\"allowscriptaccess\" value=\"always\" />
<param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id=9749744
&show_title=0&show_portrait=0&color=&fullscreen=1\" />
<em bed src=\"http://vimeo.com/moogaloop.swf?clip_id=9749744&show_title=0
&show_portrait=0&color=&fullscreen=1\" type=\"application/x-shockwave-flash\"
allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"400\"
height=\"225\"></embed>
</object>
" }
Example Usage
cURL request using Magma video id (id):
curl http://mag.ma/embed.json?id=420278
cURL request using Magma instance id (instance_id):
curl http://mag.ma/embed.json?instance_id=439007
cURL request using video URL (url):
curl http://mag.ma/embed.json?url=http://vimeo.com/9749744