Create XID

This API creates a new XID and returns it. The actual form of the ID is a decimal number, not a UUID.

The creation of the XID requires that the client supply the website that the content is being created on, for tracking purposes. It also requires that the client pass in both the policy ID (see Get Site Policies API) and the key. The key is a hex string of even length which encodes an array of random byte values.

URL format: https://host/api/xcontent
HTTP Headers: x-xloak-authtoken: auth-token
x-xloak-k: APIkey
URL Parameters: None
POST body parameters:

JSON structure that contains the following fields: “url”, “scheme”, “xpid”, “key”, and optionally “contentSize”. The value of the “url” field must be the full URL of the currently shown page on the browser; “scheme” must be the cloaking scheme as returned from the Get Site Policies API (the field name is “cipherscheme”), “xpid” is the value of a policy ID as retrieved via the Get Site Policies API, “key” is the hexadecimal representation of an array of random byte values, and “contentSize” is the size of the content supplied by the caller. Examples of parameter list are:

{"url": "", "scheme": "default", "xpid": "81", "key": "abcdef"}

{"url": "", "scheme": "default", "xpid": "81", "key": "abcdef", "contentSize": "100"}

status code 200 if the creation of the XID succeeds. The data returned is similar to the following:

{{'info': {'type': 'default', 'xid': '17', 'xpid', '81', 'key': 'abcdef'}, 'message': '', 'result': 'OK'}

Note that the key is returned along with the XID (for convenience, mostly).

status code 403 if the request is made without a valid auth token.


Later, when a request is made to fetch the key for a given XID, the terms of the XPID are tested to determine whether to honor the request. The original author, the owner of this XID, will receive the key regardless.

With domain managed accounts, the domain account administrator will also always have access to the key.

* Aug 7, 2012: Added 'contentSize' parameter to enable recording of the size of the content being scrambld