API Guide

Get Mobile Device HTML

This API returns a list of mobile devices and the corresponding HTML and JavaScript necessary to render the test result within the device frame. Data is returned in the following formats: XML, JSON, CSV and Serialized.

Required headers: X-API-KEY
Optional headers: ACCEPT (json, xml, csv, serialized)
Method: GET

Endpoint URL:

https://api.250ok.com/api/1.0/designinformant/mobiledevices

Sample Output:

[
    {
        "name": "android22",
        "image": "https://s3.amazonaws.com/250ok-devices/htc-wildfire.png",
        "html": "<div id=\"mobiledevice_rendering\" style=\"background: url(https://s3.amazonaws.com/250ok-devices/htc-wildfire.png) no-repeat 0 0; width: 421px; height: 710px; padding-top: 59px; position: relative; margin:0 auto;\">
	<div id=\"mobiledevice_container\" style=\"overflow: hidden; height: 480px; width: 320px; position: absolute; left: 52px; top: 103px;\">
		<div id=\"mobiledevice_screen\">
			  <img src=\"%!SCREENSHOT!%\" id=\"mobiledevice_image\" style=\"position:absolute; left:0\">
		</div>
	</div>
</div>",
        "js": "var heightInc = 480;
var imageTop = 0;

function scrollUp() {
    if (imageTop < 0)
    {
        imageTop += heightInc;
        document.getElementById(\"mobiledevice_image\").style.top = imageTop + \"px\";
    }
}

function scrollDown() {
    if((imageTop-100)>(document.getElementById(\"mobiledevice_image\").height*-1) + heightInc)
    {
        imageTop -= heightInc;
        document.getElementById(\"mobiledevice_image\").style.top = imageTop + \"px\";
    }
}

function onKeyDown(e)
{
    var keycode;
    if (window.event) keycode = window.event.keyCode;
    else if (e) keycode = e.which;
    console.log(keycode);
    switch (keycode)
    {
        case 38:
            scrollUp();
            return false;
            break;
        case 40:
            scrollDown();
            return false;
            break;
    }
    return true;
}

document.onkeydown = onKeyDown;"
    }
]

Parameters

Parameter Description Acceptable Values Required
name Name of a specific mobile device to retrieve. API will retrieve all devices if this parameter is not passed. String N

Error Responses

Description Code Cause
NULL 401 Your API key does not have sufficient permission to access this endpoint.