{"_id":"55fcb263a1dbbe0d001a139e","sync_unique":"","title":"Getting Started","type":"basic","__v":1,"createdAt":"2015-09-19T00:34:03.808Z","link_url":"","user":"55fcad15b652110d00758ada","api":{"settings":"","url":"","auth":"required","params":[],"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]}},"slug":"getting-started","project":"55fcad7951dbf70d00c61b3b","category":"55fcb262a1dbbe0d001a139b","hidden":false,"parentDoc":null,"link_external":false,"order":0,"updates":[],"version":"55fcb261a1dbbe0d001a139a","body":"Handset Detection is a powerful detection library that can detect millions of combinations device, operating system, browser and app. \n\nYou'll need to signup, and grab an account before you can get started.","excerpt":"This page will help you get started with HandsetDetection. You'll be up and running in no time at all.","githubsync":"","childrenPages":[]}

Getting Started

This page will help you get started with HandsetDetection. You'll be up and running in no time at all.

Handset Detection is a powerful detection library that can detect millions of combinations device, operating system, browser and app.
You'll need to signup, and grab an account before you can get started.

Handset Detection is a powerful detection library that can detect millions of combinations device, operating system, browser and app.
You'll need to signup, and grab an account before you can get started.

{"_id":"55fdfe795130171900235a80","__v":3,"api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","url":""},"hidden":false,"link_external":false,"project":"55fcad7951dbf70d00c61b3b","type":"basic","updates":[],"category":"55fcb262a1dbbe0d001a139b","githubsync":"","link_url":"","order":1,"sync_unique":"","title":"Integrations","body":"We have 3 detection methods to choose from. \n\n## Express Detection\n\nExpress Detection is our most popular detection option. Its perfect for redirecting mobile visitors to a mobile website, calling out the device type on a webpage or optimising a redirect based on carrier, location or device properties. There’s no server scripts or complicated setup. Tick a few boxes, fill out a field, then copy and paste a code snippet (javascript) into the <head> section of your web pages. Job Done. \n\nFor more information see the APIv4 - Express Detection page.\n\n## Cloud Detection\n\nCloud Detection is our medium tech solution. Choose an API Kit, configure it with your access credentials and you’re detecting devices. API kits are small footprint and give you full control over the detection process. Simply pass the HTTP headers from your web request to the API kit and it’ll pass back the detection results.\n\n## Ultimate Detection\n\nUltimate Detection is our high tech, high performance detection solution. It uses the same API kits as Cloud Detection, just flicked over into Ultimate (local) mode. Expect performance in the thousands of detections per second range on modest hardware. There are no database dependencies and everything runs completely in memory, so its blazingly fast.\n\n## Cloud Detection vs Ultimate Detection\n\nCloud and Ultimate are both built into each each supported API kit. You can switch between Cloud and Ultimate simply by changing a config file option in each kit. They also share identical API calls and identical API replies, so its a breeze to start with one and switch to the other if requirements change in the future.\n[block:callout]\n{\n \"type\": \"warning\",\n \"body\": \"You will need an Ultimate licence to download the datafiles necessary for local detection.\",\n \"title\": \"Ultimate Licence\"\n}\n[/block]\n\n[block:callout]\n{\n \"type\": \"info\",\n \"title\": \"High Accuracy\",\n \"body\": \"All our services contain enhanced checks for device type, operating system (platform), browser and app. We dig deep into the information to ensure our results are as accurate as possible and don't simply rely on the operating system or browser that shipped with a device.\"\n}\n[/block]","parentDoc":null,"slug":"integrations","version":"55fcb261a1dbbe0d001a139a","createdAt":"2015-09-20T00:31:53.133Z","excerpt":"3 ways to detect devices.","user":"55fcad15b652110d00758ada","childrenPages":[]}

Integrations

3 ways to detect devices.

We have 3 detection methods to choose from.
## Express Detection
Express Detection is our most popular detection option. Its perfect for redirecting mobile visitors to a mobile website, calling out the device type on a webpage or optimising a redirect based on carrier, location or device properties. There’s no server scripts or complicated setup. Tick a few boxes, fill out a field, then copy and paste a code snippet (javascript) into the <head> section of your web pages. Job Done.
For more information see the APIv4 - Express Detection page.
## Cloud Detection
Cloud Detection is our medium tech solution. Choose an API Kit, configure it with your access credentials and you’re detecting devices. API kits are small footprint and give you full control over the detection process. Simply pass the HTTP headers from your web request to the API kit and it’ll pass back the detection results.
## Ultimate Detection
Ultimate Detection is our high tech, high performance detection solution. It uses the same API kits as Cloud Detection, just flicked over into Ultimate (local) mode. Expect performance in the thousands of detections per second range on modest hardware. There are no database dependencies and everything runs completely in memory, so its blazingly fast.
## Cloud Detection vs Ultimate Detection
Cloud and Ultimate are both built into each each supported API kit. You can switch between Cloud and Ultimate simply by changing a config file option in each kit. They also share identical API calls and identical API replies, so its a breeze to start with one and switch to the other if requirements change in the future.
[block:callout]
{
"type": "warning",
"body": "You will need an Ultimate licence to download the datafiles necessary for local detection.",
"title": "Ultimate Licence"
}
[/block]
[block:callout]
{
"type": "info",
"title": "High Accuracy",
"body": "All our services contain enhanced checks for device type, operating system (platform), browser and app. We dig deep into the information to ensure our results are as accurate as possible and don't simply rely on the operating system or browser that shipped with a device."
}
[/block]

We have 3 detection methods to choose from.
## Express Detection
Express Detection is our most popular detection option. Its perfect for redirecting mobile visitors to a mobile website, calling out the device type on a webpage or optimising a redirect based on carrier, location or device properties. There’s no server scripts or complicated setup. Tick a few boxes, fill out a field, then copy and paste a code snippet (javascript) into the <head> section of your web pages. Job Done.
For more information see the APIv4 - Express Detection page.
## Cloud Detection
Cloud Detection is our medium tech solution. Choose an API Kit, configure it with your access credentials and you’re detecting devices. API kits are small footprint and give you full control over the detection process. Simply pass the HTTP headers from your web request to the API kit and it’ll pass back the detection results.
## Ultimate Detection
Ultimate Detection is our high tech, high performance detection solution. It uses the same API kits as Cloud Detection, just flicked over into Ultimate (local) mode. Expect performance in the thousands of detections per second range on modest hardware. There are no database dependencies and everything runs completely in memory, so its blazingly fast.
## Cloud Detection vs Ultimate Detection
Cloud and Ultimate are both built into each each supported API kit. You can switch between Cloud and Ultimate simply by changing a config file option in each kit. They also share identical API calls and identical API replies, so its a breeze to start with one and switch to the other if requirements change in the future.
[block:callout]
{
"type": "warning",
"body": "You will need an Ultimate licence to download the datafiles necessary for local detection.",
"title": "Ultimate Licence"
}
[/block]
[block:callout]
{
"type": "info",
"title": "High Accuracy",
"body": "All our services contain enhanced checks for device type, operating system (platform), browser and app. We dig deep into the information to ensure our results are as accurate as possible and don't simply rely on the operating system or browser that shipped with a device."
}
[/block]

{"_id":"55fe0f6a5c67200d00fa2f1d","createdAt":"2015-09-20T01:44:10.606Z","hidden":false,"slug":"authentication","__v":1,"api":{"params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","url":"","auth":"required"},"category":"55fcb262a1dbbe0d001a139b","githubsync":"","order":3,"user":"55fcad15b652110d00758ada","body":"Version 4 of our API uses http digest for authentication over both http, and optionally https. While http digest is great for authentication and security it does involve a challenge and its response, which doubles the request overhead.\n\nTo overcome the challenge response all API Kits 'pre compute' the challenge and send a fully formed digest header with each query. This speeds up requests and ensures web service queries can be answered in one reply. \n\n[Auth Digest at Wikipedia](http://en.wikipedia.org/wiki/Digest_access_authentication \"Auth Digest\")\n\nTo pre-compute the digest we set the realm to 'APIv4' and the nonce (from the server) to 'APIv4', then follow the [RFC-2617](https://tools.ietf.org/html/rfc2617 \"RFC 2617\") calculation for the auth digest header (which is more easily grock'd from the Wikipedia page above).","excerpt":"HTTP Digest authentication performance in API kits.","sync_unique":"","updates":[],"isReference":false,"link_external":false,"link_url":"","parentDoc":null,"project":"55fcad7951dbf70d00c61b3b","title":"Authentication","type":"basic","version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

Authentication

HTTP Digest authentication performance in API kits.

Version 4 of our API uses http digest for authentication over both http, and optionally https. While http digest is great for authentication and security it does involve a challenge and its response, which doubles the request overhead.
To overcome the challenge response all API Kits 'pre compute' the challenge and send a fully formed digest header with each query. This speeds up requests and ensures web service queries can be answered in one reply.
[Auth Digest at Wikipedia](http://en.wikipedia.org/wiki/Digest_access_authentication "Auth Digest")
To pre-compute the digest we set the realm to 'APIv4' and the nonce (from the server) to 'APIv4', then follow the [RFC-2617](https://tools.ietf.org/html/rfc2617 "RFC 2617") calculation for the auth digest header (which is more easily grock'd from the Wikipedia page above).

Version 4 of our API uses http digest for authentication over both http, and optionally https. While http digest is great for authentication and security it does involve a challenge and its response, which doubles the request overhead.
To overcome the challenge response all API Kits 'pre compute' the challenge and send a fully formed digest header with each query. This speeds up requests and ensures web service queries can be answered in one reply.
[Auth Digest at Wikipedia](http://en.wikipedia.org/wiki/Digest_access_authentication "Auth Digest")
To pre-compute the digest we set the realm to 'APIv4' and the nonce (from the server) to 'APIv4', then follow the [RFC-2617](https://tools.ietf.org/html/rfc2617 "RFC 2617") calculation for the auth digest header (which is more easily grock'd from the Wikipedia page above).

{"_id":"56f8918ed4939e0e006b43a3","hidden":false,"project":"55fcad7951dbf70d00c61b3b","user":"55fcad15b652110d00758ada","category":"55fcb262a1dbbe0d001a139b","excerpt":"Get started fast with our pre-made API kits.","githubsync":"","parentDoc":null,"title":"API Kits","updates":[],"version":"55fcb261a1dbbe0d001a139a","link_external":false,"order":4,"slug":"api-kits","createdAt":"2016-03-28T02:06:06.306Z","isReference":false,"link_url":"http://github.com/HandsetDetection","sync_unique":"","type":"basic","__v":5,"api":{"results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"settings":"","url":"","auth":"required","params":[]},"body":"Pre made API kits are available from our GitHub repos at http://github.com/HandsetDetection\n\nKits are available for [PHP](https://github.com/HandsetDetection/php-apikit \"PHP API Kit\"), [Java](https://github.com/HandsetDetection/java-apikit \"Java API Kit\"), [Python](https://github.com/HandsetDetection/python-apikit \"Python API Kit\"), [.NET](https://github.com/HandsetDetection/dotnet40-apikit \".NET API Kit\") and [Ruby on Rails](https://github.com/HandsetDetection/rails-apikit \"Ruby on Rails API Kit\") \n\nAll kits operate in both web service and local (on premise) mode and you can toggle between modes by simply changing a config file option.","childrenPages":[]}

API Kits

Get started fast with our pre-made API kits.

Pre made API kits are available from our GitHub repos at http://github.com/HandsetDetection
Kits are available for [PHP](https://github.com/HandsetDetection/php-apikit "PHP API Kit"), [Java](https://github.com/HandsetDetection/java-apikit "Java API Kit"), [Python](https://github.com/HandsetDetection/python-apikit "Python API Kit"), [.NET](https://github.com/HandsetDetection/dotnet40-apikit ".NET API Kit") and [Ruby on Rails](https://github.com/HandsetDetection/rails-apikit "Ruby on Rails API Kit")
All kits operate in both web service and local (on premise) mode and you can toggle between modes by simply changing a config file option.

Pre made API kits are available from our GitHub repos at http://github.com/HandsetDetection
Kits are available for [PHP](https://github.com/HandsetDetection/php-apikit "PHP API Kit"), [Java](https://github.com/HandsetDetection/java-apikit "Java API Kit"), [Python](https://github.com/HandsetDetection/python-apikit "Python API Kit"), [.NET](https://github.com/HandsetDetection/dotnet40-apikit ".NET API Kit") and [Ruby on Rails](https://github.com/HandsetDetection/rails-apikit "Ruby on Rails API Kit")
All kits operate in both web service and local (on premise) mode and you can toggle between modes by simply changing a config file option.

{"_id":"55fe075e948a830d0023a5aa","type":"basic","category":"55fdfec0b652110d00758b8d","createdAt":"2015-09-20T01:09:50.593Z","excerpt":"Setting up Express Detection","link_external":false,"link_url":"","project":"55fcad7951dbf70d00c61b3b","body":"","slug":"set-up","sync_unique":"","version":"55fcb261a1dbbe0d001a139a","api":{"settings":"","url":"","auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]}},"updates":[],"user":"55fcad15b652110d00758ada","__v":2,"githubsync":"","hidden":false,"order":0,"parentDoc":null,"title":"Set up with the Wizard","childrenPages":[]}

Set up with the Wizard

{"_id":"55fe07735c67200d00fa2f10","__v":2,"createdAt":"2015-09-20T01:10:11.143Z","link_url":"","parentDoc":null,"title":"With Wordpress","excerpt":"Using Express Detection with Wordpress","link_external":false,"type":"basic","api":{"auth":"required","params":[],"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"name":"","status":400,"language":"json","code":"{}"}]},"settings":"","url":""},"category":"55fdfec0b652110d00758b8d","githubsync":"","order":1,"slug":"with-wordpress","user":"55fcad15b652110d00758ada","body":"Login to Handset Detection, create your site and setup any redirection rules. \n\nAfter you’ve completed that grab the Site ID, this is the unique number which we use to reference your site internally.\n\nPaste the script below into your wordpress theme’s function.php file by Logging in to WordPress, then click Dashboard > Appearance > Editor. \n\nFrom the menu on the right hand side choose the Theme Functions (functions.php) file.\nCopy and the snippet below and paste it into the very end of the file. \n\nAfter pasting, substitute your Site ID for xxx, then save the file.\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"/**\\n ** Handset Detection\\n **/\\nif (! is_admin()) {\\n wp_enqueue_script('handsetdetection', 'http://api.handsetdetection.com/sites/js/xxx.js', '1' , 0);\\n}\\n\",\n \"language\": \"php\"\n }\n ]\n}\n[/block]\nJob done ! Now test.\n\nThis snippet ensures that detection will only take place on the standard pages for the WordPress website, not the admin pages. \n\nFor best results enable ‘Smart Redirection’ on your website settings in Handset Detection.","hidden":false,"project":"55fcad7951dbf70d00c61b3b","sync_unique":"","updates":[],"version":"55fcb261a1dbbe0d001a139a","childrenPages":[]}

With Wordpress

Using Express Detection with Wordpress

Login to Handset Detection, create your site and setup any redirection rules.
After you’ve completed that grab the Site ID, this is the unique number which we use to reference your site internally.
Paste the script below into your wordpress theme’s function.php file by Logging in to WordPress, then click Dashboard > Appearance > Editor.
From the menu on the right hand side choose the Theme Functions (functions.php) file.
Copy and the snippet below and paste it into the very end of the file.
After pasting, substitute your Site ID for xxx, then save the file.
[block:code]
{
"codes": [
{
"code": "/**\n ** Handset Detection\n **/\nif (! is_admin()) {\n wp_enqueue_script('handsetdetection', 'http://api.handsetdetection.com/sites/js/xxx.js', '1' , 0);\n}\n",
"language": "php"
}
]
}
[/block]
Job done ! Now test.
This snippet ensures that detection will only take place on the standard pages for the WordPress website, not the admin pages.
For best results enable ‘Smart Redirection’ on your website settings in Handset Detection.

Login to Handset Detection, create your site and setup any redirection rules.
After you’ve completed that grab the Site ID, this is the unique number which we use to reference your site internally.
Paste the script below into your wordpress theme’s function.php file by Logging in to WordPress, then click Dashboard > Appearance > Editor.
From the menu on the right hand side choose the Theme Functions (functions.php) file.
Copy and the snippet below and paste it into the very end of the file.
After pasting, substitute your Site ID for xxx, then save the file.
[block:code]
{
"codes": [
{
"code": "/**\n ** Handset Detection\n **/\nif (! is_admin()) {\n wp_enqueue_script('handsetdetection', 'http://api.handsetdetection.com/sites/js/xxx.js', '1' , 0);\n}\n",
"language": "php"
}
]
}
[/block]
Job done ! Now test.
This snippet ensures that detection will only take place on the standard pages for the WordPress website, not the admin pages.
For best results enable ‘Smart Redirection’ on your website settings in Handset Detection.

{"_id":"55fe082a948a830d0023a5ac","updates":[],"version":"55fcb261a1dbbe0d001a139a","api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":"","auth":"required","params":[]},"type":"basic","parentDoc":null,"__v":1,"body":"There’s a few advanced edge cases where you might want to force disable javascript redirection. \n\nHere’s how to do it.\n\n1) Check the ‘Manual Override’ box on your site profile.\n2) Append the &expressredirect=false to your URL.\n\nJob Done – That was easy. :)","category":"55fdfec0b652110d00758b8d","order":5,"sync_unique":"","title":"Manual override","user":"55fcad15b652110d00758ada","createdAt":"2015-09-20T01:13:14.065Z","hidden":false,"link_url":"","project":"55fcad7951dbf70d00c61b3b","slug":"manual-override","excerpt":"Prevent express redirection when required.","githubsync":"","link_external":false,"childrenPages":[]}

Manual override

Prevent express redirection when required.

There’s a few advanced edge cases where you might want to force disable javascript redirection.
Here’s how to do it.
1) Check the ‘Manual Override’ box on your site profile.
2) Append the &expressredirect=false to your URL.
Job Done – That was easy. :)

There’s a few advanced edge cases where you might want to force disable javascript redirection.
Here’s how to do it.
1) Check the ‘Manual Override’ box on your site profile.
2) Append the &expressredirect=false to your URL.
Job Done – That was easy. :)

{"_id":"571847bfc7b52619003f61c8","title":"Configuring API kits","updates":[],"api":{"auth":"required","params":[],"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"link_external":false,"order":2,"project":"55fcad7951dbf70d00c61b3b","githubsync":"","isReference":false,"parentDoc":null,"version":"55fcb261a1dbbe0d001a139a","link_url":"","slug":"configuring-api-kits","sync_unique":"","type":"basic","__v":2,"category":"55fe128bcc468e0d008dcde3","hidden":false,"user":"55fcad15b652110d00758ada","body":"All API kits are broadly the same and follow similar design patterns, however sometimes config options can vary a bit from kit to kit.\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<?php\\n$hdconfig['username'] = \\\"***API-USERNAME***\\\";\\n$hdconfig['secret'] = \\\"***API-SECRET***\\\";\\n$hdconfig['site_id'] = \\\"***SITE-ID***\\\";\\n$hdconfig['use_local'] = false;\\n$hdconfig['filesdir'] = '/tmp';\\n$hdconfig['debug'] = false;\\n$hdconfig['api_server'] = 'api.handsetdetection.com';\\n$hdconfig['cache_requests'] = false;\\n$hdconfig['geoip'] = true;\\n$hdconfig['timeout'] = 10;\\n$hdconfig['use_proxy'] = false;\\n$hdconfig['proxy_server'] = '';\\n$hdconfig['proxy_port'] = '';\\n$hdconfig['proxy_user'] = '';\\n$hdconfig['proxy_pass'] = '';\\n$hdconfig['retries'] = 3;\\n?>\",\n \"language\": \"php\"\n },\n {\n \"code\": \"#common\\ncommon.username=***API-USERNAME***\\ncommon.secret=***API-SECRET***\\ncommon.site_id=***SITE-ID***\\ncommon.non_mobile=\\ncommon.match_filter=\\ncommon.use_local=false\\n\\n#socket connection timeouts\\nconnection.connect_timeout=5\\nconnection.read_timeout=5\\n\\n#proxy\\nproxy.enabled=false\\nproxy.address=\\nproxy.port=\\nproxy.username=\\nproxy.password=\\n\\n#local directory for downloaded files (Ultimate only)\\nlocal.files.directory=/tmp\\n\\n#logging\\nlogger.enabled=true\",\n \"language\": \"java\"\n },\n {\n \"code\": \"config:\\n api_username: ***API-USERNAME***\\n api_secret: ***API-SECRET***\\n site_id: '***SITE-ID***'\\n use_local: False\\n filesdir: /tmp\\n debug: false\\n api_server: api.handsetdetection.com\\n cache_requests: False\\n timeout: 10\\n use_proxy: false\\n proxy_server:\\n proxy_port:\\n proxy_user:\\n proxy_pass:\\n retries: 3\\n\\n#\\n# Dogpile.cache settings.\\n# The cache defaults to backend: dogpile.cache.memory, expiry: 3600, arguments: { cache_dict: hd40cache }\\n#\\ncache:\\n backend: dogpile.cache.memcached\\n expiry: 3600\\n arguments:\\n url: 127.0.0.1:11211\",\n \"language\": \"python\"\n },\n {\n \"code\": \"// dotNet 4.0\\n{ \\n \\\"username\\\":\\\"***API-USERNAME***\\\",\\n \\\"secret\\\":\\\"***API-SECRET***\\\",\\n \\\"site_id\\\":\\\"***SITE-ID***\\\",\\n \\\"use_local\\\":\\\"false\\\",\\n \\\"filesdir\\\":\\\"\\\",\\n \\\"debug\\\":\\\"false\\\",\\n \\\"api_server\\\":\\\"api.handsetdetection.com\\\",\\n \\\"cache_requests\\\":\\\"false\\\",\\n \\\"geoip\\\":\\\"true\\\",\\n \\\"timeout\\\":\\\"10\\\",\\n \\\"use_proxy\\\":\\\"false\\\",\\n \\\"proxy_server\\\":\\\"\\\",\\n \\\"proxy_port\\\":\\\"\\\",\\n \\\"proxy_user\\\":\\\"\\\",\\n \\\"proxy_pass\\\":\\\"\\\",\\n \\\"retries\\\":\\\"3\\\",\\n \\\"log_unknown\\\":\\\"true\\\"\\n}\",\n \"language\": \"csharp\"\n }\n ]\n}\n[/block]\nusername and secret are your API connection credentials. You can find them either from the dashboard (Click on your Avatar, Select Change Settings and scroll down a little to API Connection Information, where you can also modify the details if desired), or from the site settings icon (from your main dashboard page scroll down to 'Manage Sites', then look across to the Actions section, click the 3 little orange cogs or gears, once the site settings page has loaded click the 'Ultimate' tab).\n\nsite_id, is the id of the site you wish to perform detections or downloads for.\n\nuse_local, set this to true to flip your API kit into Ultimate (local detection) mode. Set to false for cloud detection. Note : Cloud and Ultimate detection replies are virtually identical (ultimate has no GeoIP information), so you can switch between modes at the flick of a switch.\n\ndebug, set this to false, its used while debugging api kit issues and has a bit of performance overhead.\n\napi_server, this should always be api.handsetdetection.com\n\ncache_requests, a new option in api v4.0, set this to true to locally cache detection replies. Setting this to true will cause 'hot' http headers to be locally cached. This will reduce detection lookups and speed up performance in cloud mode, however as side effect it will distort analytics as cache 'hits' will not be tracked.\n\ngeoip, deprecated, this enables geoip lookups in cloud mode.\n\ntimeout, maximum duration for a cloud web service request.\n\nretires, how many times to re-try a cloud request (if it fails or timeouts).\n\nproxy options, set these if you're making cloud queries through a web proxy.\n\nThe default config filenames differ from kit to kit and the main detection classes in each language have a method of supplying a custom config file name, making switching credentials from test to production easy. See your kit of choice for examples and information.\n\nAll API kits can be found at our [Device Detection GitHub Repo](https://github.com/HandsetDetection)","createdAt":"2016-04-21T03:23:43.364Z","excerpt":"","childrenPages":[]}

Configuring API kits

All API kits are broadly the same and follow similar design patterns, however sometimes config options can vary a bit from kit to kit.
[block:code]
{
"codes": [
{
"code": "<?php\n$hdconfig['username'] = \"***API-USERNAME***\";\n$hdconfig['secret'] = \"***API-SECRET***\";\n$hdconfig['site_id'] = \"***SITE-ID***\";\n$hdconfig['use_local'] = false;\n$hdconfig['filesdir'] = '/tmp';\n$hdconfig['debug'] = false;\n$hdconfig['api_server'] = 'api.handsetdetection.com';\n$hdconfig['cache_requests'] = false;\n$hdconfig['geoip'] = true;\n$hdconfig['timeout'] = 10;\n$hdconfig['use_proxy'] = false;\n$hdconfig['proxy_server'] = '';\n$hdconfig['proxy_port'] = '';\n$hdconfig['proxy_user'] = '';\n$hdconfig['proxy_pass'] = '';\n$hdconfig['retries'] = 3;\n?>",
"language": "php"
},
{
"code": "#common\ncommon.username=***API-USERNAME***\ncommon.secret=***API-SECRET***\ncommon.site_id=***SITE-ID***\ncommon.non_mobile=\ncommon.match_filter=\ncommon.use_local=false\n\n#socket connection timeouts\nconnection.connect_timeout=5\nconnection.read_timeout=5\n\n#proxy\nproxy.enabled=false\nproxy.address=\nproxy.port=\nproxy.username=\nproxy.password=\n\n#local directory for downloaded files (Ultimate only)\nlocal.files.directory=/tmp\n\n#logging\nlogger.enabled=true",
"language": "java"
},
{
"code": "config:\n api_username: ***API-USERNAME***\n api_secret: ***API-SECRET***\n site_id: '***SITE-ID***'\n use_local: False\n filesdir: /tmp\n debug: false\n api_server: api.handsetdetection.com\n cache_requests: False\n timeout: 10\n use_proxy: false\n proxy_server:\n proxy_port:\n proxy_user:\n proxy_pass:\n retries: 3\n\n#\n# Dogpile.cache settings.\n# The cache defaults to backend: dogpile.cache.memory, expiry: 3600, arguments: { cache_dict: hd40cache }\n#\ncache:\n backend: dogpile.cache.memcached\n expiry: 3600\n arguments:\n url: 127.0.0.1:11211",
"language": "python"
},
{
"code": "// dotNet 4.0\n{ \n \"username\":\"***API-USERNAME***\",\n \"secret\":\"***API-SECRET***\",\n \"site_id\":\"***SITE-ID***\",\n \"use_local\":\"false\",\n \"filesdir\":\"\",\n \"debug\":\"false\",\n \"api_server\":\"api.handsetdetection.com\",\n \"cache_requests\":\"false\",\n \"geoip\":\"true\",\n \"timeout\":\"10\",\n \"use_proxy\":\"false\",\n \"proxy_server\":\"\",\n \"proxy_port\":\"\",\n \"proxy_user\":\"\",\n \"proxy_pass\":\"\",\n \"retries\":\"3\",\n \"log_unknown\":\"true\"\n}",
"language": "csharp"
}
]
}
[/block]
username and secret are your API connection credentials. You can find them either from the dashboard (Click on your Avatar, Select Change Settings and scroll down a little to API Connection Information, where you can also modify the details if desired), or from the site settings icon (from your main dashboard page scroll down to 'Manage Sites', then look across to the Actions section, click the 3 little orange cogs or gears, once the site settings page has loaded click the 'Ultimate' tab).
site_id, is the id of the site you wish to perform detections or downloads for.
use_local, set this to true to flip your API kit into Ultimate (local detection) mode. Set to false for cloud detection. Note : Cloud and Ultimate detection replies are virtually identical (ultimate has no GeoIP information), so you can switch between modes at the flick of a switch.
debug, set this to false, its used while debugging api kit issues and has a bit of performance overhead.
api_server, this should always be api.handsetdetection.com
cache_requests, a new option in api v4.0, set this to true to locally cache detection replies. Setting this to true will cause 'hot' http headers to be locally cached. This will reduce detection lookups and speed up performance in cloud mode, however as side effect it will distort analytics as cache 'hits' will not be tracked.
geoip, deprecated, this enables geoip lookups in cloud mode.
timeout, maximum duration for a cloud web service request.
retires, how many times to re-try a cloud request (if it fails or timeouts).
proxy options, set these if you're making cloud queries through a web proxy.
The default config filenames differ from kit to kit and the main detection classes in each language have a method of supplying a custom config file name, making switching credentials from test to production easy. See your kit of choice for examples and information.
All API kits can be found at our [Device Detection GitHub Repo](https://github.com/HandsetDetection)

All API kits are broadly the same and follow similar design patterns, however sometimes config options can vary a bit from kit to kit.
[block:code]
{
"codes": [
{
"code": "<?php\n$hdconfig['username'] = \"***API-USERNAME***\";\n$hdconfig['secret'] = \"***API-SECRET***\";\n$hdconfig['site_id'] = \"***SITE-ID***\";\n$hdconfig['use_local'] = false;\n$hdconfig['filesdir'] = '/tmp';\n$hdconfig['debug'] = false;\n$hdconfig['api_server'] = 'api.handsetdetection.com';\n$hdconfig['cache_requests'] = false;\n$hdconfig['geoip'] = true;\n$hdconfig['timeout'] = 10;\n$hdconfig['use_proxy'] = false;\n$hdconfig['proxy_server'] = '';\n$hdconfig['proxy_port'] = '';\n$hdconfig['proxy_user'] = '';\n$hdconfig['proxy_pass'] = '';\n$hdconfig['retries'] = 3;\n?>",
"language": "php"
},
{
"code": "#common\ncommon.username=***API-USERNAME***\ncommon.secret=***API-SECRET***\ncommon.site_id=***SITE-ID***\ncommon.non_mobile=\ncommon.match_filter=\ncommon.use_local=false\n\n#socket connection timeouts\nconnection.connect_timeout=5\nconnection.read_timeout=5\n\n#proxy\nproxy.enabled=false\nproxy.address=\nproxy.port=\nproxy.username=\nproxy.password=\n\n#local directory for downloaded files (Ultimate only)\nlocal.files.directory=/tmp\n\n#logging\nlogger.enabled=true",
"language": "java"
},
{
"code": "config:\n api_username: ***API-USERNAME***\n api_secret: ***API-SECRET***\n site_id: '***SITE-ID***'\n use_local: False\n filesdir: /tmp\n debug: false\n api_server: api.handsetdetection.com\n cache_requests: False\n timeout: 10\n use_proxy: false\n proxy_server:\n proxy_port:\n proxy_user:\n proxy_pass:\n retries: 3\n\n#\n# Dogpile.cache settings.\n# The cache defaults to backend: dogpile.cache.memory, expiry: 3600, arguments: { cache_dict: hd40cache }\n#\ncache:\n backend: dogpile.cache.memcached\n expiry: 3600\n arguments:\n url: 127.0.0.1:11211",
"language": "python"
},
{
"code": "// dotNet 4.0\n{ \n \"username\":\"***API-USERNAME***\",\n \"secret\":\"***API-SECRET***\",\n \"site_id\":\"***SITE-ID***\",\n \"use_local\":\"false\",\n \"filesdir\":\"\",\n \"debug\":\"false\",\n \"api_server\":\"api.handsetdetection.com\",\n \"cache_requests\":\"false\",\n \"geoip\":\"true\",\n \"timeout\":\"10\",\n \"use_proxy\":\"false\",\n \"proxy_server\":\"\",\n \"proxy_port\":\"\",\n \"proxy_user\":\"\",\n \"proxy_pass\":\"\",\n \"retries\":\"3\",\n \"log_unknown\":\"true\"\n}",
"language": "csharp"
}
]
}
[/block]
username and secret are your API connection credentials. You can find them either from the dashboard (Click on your Avatar, Select Change Settings and scroll down a little to API Connection Information, where you can also modify the details if desired), or from the site settings icon (from your main dashboard page scroll down to 'Manage Sites', then look across to the Actions section, click the 3 little orange cogs or gears, once the site settings page has loaded click the 'Ultimate' tab).
site_id, is the id of the site you wish to perform detections or downloads for.
use_local, set this to true to flip your API kit into Ultimate (local detection) mode. Set to false for cloud detection. Note : Cloud and Ultimate detection replies are virtually identical (ultimate has no GeoIP information), so you can switch between modes at the flick of a switch.
debug, set this to false, its used while debugging api kit issues and has a bit of performance overhead.
api_server, this should always be api.handsetdetection.com
cache_requests, a new option in api v4.0, set this to true to locally cache detection replies. Setting this to true will cause 'hot' http headers to be locally cached. This will reduce detection lookups and speed up performance in cloud mode, however as side effect it will distort analytics as cache 'hits' will not be tracked.
geoip, deprecated, this enables geoip lookups in cloud mode.
timeout, maximum duration for a cloud web service request.
retires, how many times to re-try a cloud request (if it fails or timeouts).
proxy options, set these if you're making cloud queries through a web proxy.
The default config filenames differ from kit to kit and the main detection classes in each language have a method of supplying a custom config file name, making switching credentials from test to production easy. See your kit of choice for examples and information.
All API kits can be found at our [Device Detection GitHub Repo](https://github.com/HandsetDetection)

{"_id":"5718416c951a050e00645688","slug":"getting-started-with-ultimate-community-full-editions","hidden":false,"isReference":false,"link_external":false,"__v":1,"project":"55fcad7951dbf70d00c61b3b","user":"55fcad15b652110d00758ada","createdAt":"2016-04-21T02:56:44.505Z","link_url":"","order":3,"parentDoc":null,"sync_unique":"","api":{"auth":"required","params":[],"results":{"codes":[{"name":"","status":200,"language":"json","code":"{}"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"body":"Ultimate Detection is our stand alone detection product. It includes everything you need to run local high performance device, platform (operating system), browser and app detections locally on your own servers. \n\nThe system is composed of two main components, 1) an API Kit and 2) a ZIP archive containing all the files needed to detect things (devices, platforms, browsers, applications and their detection trees). The archive has over 27,000 files, one for each thing.\n\nThe archive can be fetched via the dashboard and installed manually or fetched via an API kit, which fetches, unpacks and installs everything ready for use. Both options require you to configure your API Kit before the files can be used. \n\nSee the 'Configuring API kits' section for more information.\n\n**Manual installation can be a little tricky**. Here's a few pro tips to get you through the dark night. The API kit will look for a directory called hd40store in the directory specified in your API kit config file. So, if you specify /tmp as the target directory then unzip the archive to /tmp/hd40store. Ensure the files and directory have appropriate permissions for read access by your web server or any other accounts using the API kit.","category":"55fe128bcc468e0d008dcde3","type":"basic","title":"Getting started with Ultimate (community & full editions).","updates":[],"version":"55fcb261a1dbbe0d001a139a","excerpt":"","githubsync":"","childrenPages":[]}

Getting started with Ultimate (community & full editions).

Ultimate Detection is our stand alone detection product. It includes everything you need to run local high performance device, platform (operating system), browser and app detections locally on your own servers.
The system is composed of two main components, 1) an API Kit and 2) a ZIP archive containing all the files needed to detect things (devices, platforms, browsers, applications and their detection trees). The archive has over 27,000 files, one for each thing.
The archive can be fetched via the dashboard and installed manually or fetched via an API kit, which fetches, unpacks and installs everything ready for use. Both options require you to configure your API Kit before the files can be used.
See the 'Configuring API kits' section for more information.
**Manual installation can be a little tricky**. Here's a few pro tips to get you through the dark night. The API kit will look for a directory called hd40store in the directory specified in your API kit config file. So, if you specify /tmp as the target directory then unzip the archive to /tmp/hd40store. Ensure the files and directory have appropriate permissions for read access by your web server or any other accounts using the API kit.

Ultimate Detection is our stand alone detection product. It includes everything you need to run local high performance device, platform (operating system), browser and app detections locally on your own servers.
The system is composed of two main components, 1) an API Kit and 2) a ZIP archive containing all the files needed to detect things (devices, platforms, browsers, applications and their detection trees). The archive has over 27,000 files, one for each thing.
The archive can be fetched via the dashboard and installed manually or fetched via an API kit, which fetches, unpacks and installs everything ready for use. Both options require you to configure your API Kit before the files can be used.
See the 'Configuring API kits' section for more information.
**Manual installation can be a little tricky**. Here's a few pro tips to get you through the dark night. The API kit will look for a directory called hd40store in the directory specified in your API kit config file. So, if you specify /tmp as the target directory then unzip the archive to /tmp/hd40store. Ensure the files and directory have appropriate permissions for read access by your web server or any other accounts using the API kit.

In the example (to the left) if x-local-harwdareinfo were not supplied then the device would detect as a standard Apple iPhone. See [Enhancing detection results](doc:enhancing-detection-results) ] for a discussion.

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

In the example (to the left) if x-local-harwdareinfo were not supplied then the device would detect as a standard Apple iPhone. See [Enhancing detection results](doc:enhancing-detection-results) ] for a discussion.

Get more information about valid UIDevice keys and utsname.* at the [Apple Developer Docs](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice[Apple Developer Docs) and on [Stack Overflow](http://stackoverflow.com/questions/14716754/get-device-type-model)

Definition

{{ api_url }}{{ page_api_url }}

Examples

Result Format

Get more information about valid UIDevice keys and utsname.* at the [Apple Developer Docs](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDevice_Class/index.html#//apple_ref/occ/instp/UIDevice[Apple Developer Docs) and on [Stack Overflow](http://stackoverflow.com/questions/14716754/get-device-type-model)