Skip to content
Aron Griffis edited this page Aug 27, 2018 · 5 revisions

License POST method

Posting to the /licenses URL path in the admin-api will create a new license. The JSON value posted represents the new license to be created, and to what objects it should apply.

A typical post might be to a URL like https://secure.agilepdf.com/admin-api/9p2/licenses, with a message body like this:

{
	"user-name": "dgd@tizra.com",
	"offer-id": "8og9o",
	"match-objects": true,
	"match-property": "AdminTags",
	"match-values": [
		"value1", "value2"
	]
}

A simpler specification could be:

{
   "user-set-name": "license-test-user-set",
   "offer-id": "qdp"
}

License specifications are also used in session-login requests to specify privileges to be applied to a newly logged-in user, in which case, the account and user set information should not be used, as the affected account is already known. See the (discussion of session logins for examples)[POST-session-login]

A license specification is a map with the following fields:

  • offer-id This field is mandatory and represents an offer describing rights that should beused by the new license. The object controlled by the license will be the same as the one controlled by the offer, unless a match on the metadata is specified by the use of the match-property and match-values fields.
  • user-name specifies the user-name of an account that should be granted access by this license. If the specified user account does not exist, it will be created.
  • user-set-name specifies the name of a user set, to which the license created will be be attached. Only one of the fields user-name or user-set-name should be specified in any request.
  • match-objects if this field is false or not present, the offer should be applied directly, granting access to the object that owns it. If this field is present, and has the value true, the terms of the offer will be applied to all matching Tizra objects as determined by the match-property and match-values fields.
  • match-property The name of a Tizra property that should be used as a key to match values to determine access rights, if the object controlled by the offer is not to be used.
  • match-values This value is an array of string values. Any Tizra object that matches any of these values will get access.
  • props If present, this value should be a map, specifying the string values of properties that should be set on the license. If this field is not present, license properties will be copied from the offer provided. In most cases, you will not need to specify this field.