How To Add a Target
You can add targets to a Cloud Database using the Vuforia Web Services REST API, by making an HTTP POST request to https://vws.vuforia.com/targets. The request header should include the authorization fields described in the article Vuforia Web Services guide, and it should declare an application/JSON content type. The body of the request must be a JSON object that defines the properties of the targets as specified here.
Add a digital content payload
Vuforia Engine's Cloud Recognition service lets you add a digital content payload to your target. You can include up to 1 MB of base 64 encoded content as metadata attached to the target's search result. Examples of this content could be images or mobile-optimized 3D models. This feature lets you host your content with your targets in the Cloud Recognition service.
The developer CMS performs an HTTPS POST on https://vws.vuforia.com/targets. The header contains the usual HTTP header fields plus the Authorization field, and the JSON body contains the new target information, including the image. The
PostNewTarget.java sample shown below displays this code.
JSON body elements
The JSON body elements are listed in the following table.
||String [1 - 64]
||Name of the target, unique within a database
||Width of the target in scene unit
||Base64 encoded binary image file in JPG or PNG format
||Contains the base64 encoded binary recognition image data
||Indicates whether or not the target is active for query
||Base64 encoded data
||The base64 encoded application metadata associated with the target
JSON POST code example
POST /targets HTTP/1.1
Date: Mon, 23 Apr 2012 12:45:19 GMT
Authorization: VWS df8d23140eb443505c0661c5b58294ef472baf64:jHX6oLeqTXpynyqcvVC2MSHarhU