Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Intel® Technology Access REST API Guide

$
0
0

Intel® Technology Access Software
REST API Documentation
June 2014
Rev 1.0

Intel Confidential

2 in 1 Resources

Reads the 2-in-1 sensor value via a GET request or by using long polling APIs.

Resource

Description

GET /sensors/2in1/value

Returns the current value of the 2 in 1 sensor.

POST /sensors/2in1/events

Registers for 2 in 1 event notification. Returns a unique token and eventid, which specifies the initial location to poll at.

GET /sensors/2in1/events/:token/:eventid

Returns the current value of the 2-in-1 sensor and the next eventid to poll for when using long polling.

DELETE /sensors/2in1/events/:token

Unregisters for 2-in-1 event notification.

 

GET /sensors/2in1/value

Returns the current value of the 2-in-1 sensor in JSON format. Possible values for mode can be “laptop” or “tablet.”

Parameters:
None

Example Request:
GET                 http://172.16.0.1/sensors/2in1/value

Example Response:

{
      "mode": "laptop"
}


 

POST /sensors/2in1/events

Registers for 2-in-1 event notification when using long polling. Returns a token followed by an eventid in JSON format.

Parameters:
None

Example Request:
POST               http://172.16.0.1/sensors/2in1/events

Example Response:

{
      "token": "IamaGuid716",
      "nextEventId": "17460"
}


 

GET /sensors/2in1/events/<token>/<eventid>

Returns the current value of the 2-in-1 sensor and the next event id to poll for in JSON format. Must register for 2 in 1 event notification before using this call.

Parameters:

token
(required)

The token obtained when registering for 2-in-1 event notification

eventid
(required)

The eventid obtained when registering for 2-in-1 event notification or the current eventid to poll for

 

Example Request:
GET                 http://172.16.0.1/sensors/2in1/events/IamaGuid716/17460

Example Response:

{
     "mode": "tablet",
     "nextEventId": "17461"
}

In the example above, the next event id is 17461. The next 2-in-1 request should be polled at http://172.16.0.1/sensors/2in1/events/IamaGuid716/17461.


 

DELETE /sensors/2in1/events/<token>

Unregisters for 2-in-1 event notification. Returns true upon success in JSON format.

Parameters:

token
(required)

The token obtained when registering for 2-in-1 event notification

 

Example Request:
DELETE           http://172.16.0.1/sensors/2in1/events/IamaGuid716

Example Response:

{
     "value": "true"
}


 

Legal Information

INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.

A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS.

Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined". Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information.

The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request.

Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order.

Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or go to: http://www.intel.com/design/literature.htm.

All products, platforms, dates, and figures specified are preliminary based on current expectations, and are subject to change without notice. All dates specified are target dates, are provided for planning purposes only and are subject to change.

This document contains information on products in the design phase of development. Do not finalize a design with this information. Revised information will be published when the product is available. Verify with your local sales office that you have the latest datasheet before finalizing a design.

Code names featured are used internally within Intel to identify products that are in development and not yet publicly announced for release. Customers, licensees and other third parties are not authorized by Intel to use code names in advertising, promotion or marketing of any product or services and any such use of Intel's internal code names is at the sole risk of the user.

Intel, the Intel logo, Intel® Technology Access are trademarks of Intel Corporation in the U.S. and/or other countries.

Windows is a registered trademark of Microsoft Corporation in the United States and other countries.

*Other names and brands may be claimed as the property of others.

Copyright © 2014 Intel Corporation. All rights reserved.


Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>