Table of Contents
- Get Started: Access the services with your application.
- Log your end user in.
- Download a list of context types.
- Upload and download sample context information.
- Set a watch for particular context types, and then view new items of that type.
- Delete the watches that you created while using this test page.
In the steps that follow, the boxes on the left show the code that is executed and the boxes on the right show the results of the API calls. This page works best with Chrome browsers version 23 and above.
To begin, register your application and obtain an application API Key and a Secret Key from the Intel® Cloud Services Platform Portal located here. This application API Key and Secret Key are required for your application to access all of Context Services.
Note: The application API Key and Secret key used for this demo aplication must be associated with the "devtest" environment, and the Callback URL must be set to urn:intel:identity:oauth:oob:async.
Enter your API Key and Secret Key in the boxes below, or use the default API Key and Secret below.
To access the Context Services API, the application must log the End User into the Intel services gateway with a user authorization token. Getting a user authorization token requires the following 3-step process:
- Call the Intel® Identity Services site to allow the End User to log in. Note: Include the appropriate Context Services scopes in your call. For this demo, the necessary scopes are context:location:checkin for getting point of interest check-ins, and context:post:location:checkin for posting check-ins.
- Request an OAUTH2 authorization code.
- Request an OAUTH2 access token.
This access token is required to access the rest of the Cloud Services Platform services, and is good for this session only.
Execute all three buttons in this order to fully create a session with the Intel services gateway, and get the access token.
To run the Intel Identity UI on its own, click here. This enables you to manually log out.
Log In to Intel® Identity Services
Get Authorization Code
Get Access Token
The application can download a list of context types. The services returns a JSON schema describing all the types of context that the application can upload and download from Context Services. We will be using context type urn:x-intel:context:type:location:checkin:v1 for this test application. Note: you only need application authorization to download context types.
Download Context Types
With the following code, the application can upload a sample context item of type urn:x-intel:context:type:location:checkin:v1.
Upload Test Item
Then, with the code below, the application downloads all of the previously uploaded items of type urn:x-intel:context:type:location:checkin:v1.
Download and View Test Items
The application can set a watch for a particular context type. A watch allows the application to download only the latest context items uploaded for a given context type. The following code sets a watch for new context items of context type urn:x-intel:context:type:location:checkin:v1.
Set a Watch
After you set the watch, go back up to the "Upload Test Item" section and click Execute to check in another context item. Then, execute the code below to view the context items uploaded since the watch was set.
View new Items
To complete the demo, you can delete the watches you have created.