Licensing Service (LIC) Client Library

Primavera licensing service API.

REST Service Client

Class Description
LicensingClient The entry point of the Licensing Service client library.

Client Controllers

Class Description
Licenses Provides operations on licenses.

Models

Class Description
Account Describes an account.
AccountManager Describes an account manager.
AppInstanceContext Describes an app instance context.
Customer Describes a customer.
Grant Describes a grant.
Instance Describes an instance.
Licensee Describes a licensee.
LicensingError Describes a licensing error.
LicensingWarning Describes a licensing warning.
ModelWithProperties Describes a model with properties.
RegisterOperationResult Describes a register operation result.
RegistrationRequest Describes a registration request.
Solution Describes a solution.
Subscription Describes a subscription.
SubscriptionInfo Describes a subscription.
SubscriptionInfoList Describes a subscription info list.
SubscriptionInstance Describes a subscription instance.
SubscriptionInstancesOperationResult Describes a subscription instances operation result.
SubscriptionParameter Describes a subscription parameter.
SubscriptionUser Describes a subscription user.
ValidationOperationResult Describes a validation operation result.
ValidationRequest Describes a validation request.
ValidationResult Describes a validation result.

Enumerations

Class Description
ErrorCode Error codes used in licensing error messages.
SubscriptionUserRole The types of roles for the users.
WarningCode Possible licensing warnning codes.

Authorization Policies

Policy Description Scope
DefaultScope Defines an authorization policy that requires the default scope. lithium-licensing
LicensingPublicPages Policy that authenticates the public licensing webpages. N/A
TenantAccessValidation Validates the caller has access to the tenant. N/A

Reference

REST Service Client Classes

LicensingClient

Constructors
LicensingClient(Uri, BearerTokenCredential)
Parameter Type Description
serviceUri Uri The service URI.
credential BearerTokenCredential The credential that should be used to access the service.
LicensingClient(Uri, BearerTokenCredential, LicensingClientOptions)
Parameter Type Description
serviceUri Uri The service URI.
credential BearerTokenCredential The credential that should be used to access the service.
clientOptions LicensingClientOptions The client options.
Example
Uri address = new Uri("[service-address]");
Uri authorizationServer = new Uri("[authorization-server]");
string clientId = "[client-id]"
string clientSecret = "[client-secret]"

LicensingClient client = new LicensingClient(
    new Uri(address),
    new ClientSecretCredential(
        authorizationServer,
        clientId,
        clientSecret));

^ Back to top

Client Controllers Classes

LicensesClientController

Provides operations on licenses.

Methods
ConnectAsync()

System handshake.

public async Task<RestServiceResult<string>> ConnectAsync(string workspace, string organization, string appInstance, string productId, string systemId, CancellationToken cancellationToken = default);

public RestServiceResult<string> Connect(string workspace, string organization, string appInstance, string productId, string systemId);
Parameters
Parameter Type Description Rules
workspace string The workspace. Required.
organization string The organization. Required.
appInstance string The app instance. Required.
productId string The product identifier. Required.
systemId string The system identifier. Required.
Returns
Return Type Description
string The system public key.
Status Codes
Status Code Description
HttpStatusCode.Ok Success.
HttpStatusCode.BadRequest Failure: the request is invalid.
HttpStatusCode.NotFound Failure: not found.
HttpStatusCode.Conflict Failure: conflict.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

GetSubscriptionInstancesAsync()

Gets subscription instances.

public async Task<RestServiceResult<Cegid.Lithium.Licensing.Client.Rest.Models.SubscriptionInstancesOperationResult>> GetSubscriptionInstancesAsync(string workspace, string organization, string appInstance, string productId, string systemId, CancellationToken cancellationToken = default);

public RestServiceResult<Cegid.Lithium.Licensing.Client.Rest.Models.SubscriptionInstancesOperationResult> GetSubscriptionInstances(string workspace, string organization, string appInstance, string productId, string systemId);
Parameters
Parameter Type Description Rules
workspace string The workspace. Required.
organization string The organization. Required.
appInstance string The app instance. Required.
productId string The product identifier. Required.
systemId string The system identifier. Required.
Returns
Return Type Description
Cegid.Lithium.Licensing.Client.Rest.Models.SubscriptionInstancesOperationResult A subscription instance.
Status Codes
Status Code Description
HttpStatusCode.Ok Success.
HttpStatusCode.BadRequest Failure: the request is invalid.
HttpStatusCode.NotFound Failure: not found.
HttpStatusCode.Conflict Failure: conflict.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

GetSubsctiptionAsync()

Gets the subscription.

public async Task<RestServiceResult<Cegid.Lithium.Licensing.Client.Rest.Models.Subscription>> GetSubsctiptionAsync(string workspace, string organization, string appInstance, string productId, string systemId, CancellationToken cancellationToken = default);

public RestServiceResult<Cegid.Lithium.Licensing.Client.Rest.Models.Subscription> GetSubsctiption(string workspace, string organization, string appInstance, string productId, string systemId);
Parameters
Parameter Type Description Rules
workspace string The workspace. Required.
organization string The organization. Required.
appInstance string The app instance. Required.
productId string The product identifier. Required.
systemId string The system identifier. Required.
Returns
Return Type Description
Cegid.Lithium.Licensing.Client.Rest.Models.Subscription The subscription.
Status Codes
Status Code Description
HttpStatusCode.Ok Success.
HttpStatusCode.BadRequest Failure: the request is invalid.
HttpStatusCode.NotFound Failure: not found.
HttpStatusCode.Conflict Failure: conflict.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

RegisterAsync()

Register a subscription.

public async Task<RestServiceResult<Cegid.Lithium.Licensing.Client.Rest.Models.RegisterOperationResult>> RegisterAsync(string workspace, string organization, string appInstance, string productId, string systemId, Cegid.Lithium.Licensing.Client.Rest.Models.RegistrationRequest registrationRequest, CancellationToken cancellationToken = default);

public RestServiceResult<Cegid.Lithium.Licensing.Client.Rest.Models.RegisterOperationResult> Register(string workspace, string organization, string appInstance, string productId, string systemId, Cegid.Lithium.Licensing.Client.Rest.Models.RegistrationRequest registrationRequest);
Parameters
Parameter Type Description Rules
workspace string The workspace. Required.
organization string The organization. Required.
appInstance string The app instance. Required.
productId string The product identifier. Required.
systemId string The system identifier. Required.
registrationRequest Cegid.Lithium.Licensing.Client.Rest.Models.RegistrationRequest The registration request. Required.
Returns
Return Type Description
Cegid.Lithium.Licensing.Client.Rest.Models.RegisterOperationResult A register operation result.
Status Codes
Status Code Description
HttpStatusCode.Ok Success.
HttpStatusCode.BadRequest Failure: the request is invalid.
HttpStatusCode.NotFound Failure: not found.
HttpStatusCode.Conflict Failure: conflict.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

RemoveRegistrationAsync()

Removes registration.

public async Task<RestServiceResult> RemoveRegistrationAsync(string workspace, string organization, string appInstance, string productId, string systemId, CancellationToken cancellationToken = default);

public RestServiceResult RemoveRegistration(string workspace, string organization, string appInstance, string productId, string systemId);
Parameters
Parameter Type Description Rules
workspace string The workspace. Required.
organization string The organization. Required.
appInstance string The app instance. Required.
productId string The product identifier. Required.
systemId string The system identifier. Required.
Returns
Return Type Description
None The operation has no return value.
Status Codes
Status Code Description
HttpStatusCode.Ok Success.
HttpStatusCode.BadRequest Failure: the request is invalid.
HttpStatusCode.NotFound Failure: not found.
HttpStatusCode.Conflict Failure: conflict.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

ValidateAsync()

Validate license.

public async Task<RestServiceResult<Cegid.Lithium.Licensing.Client.Rest.Models.ValidationOperationResult>> ValidateAsync(string workspace, string organization, string appInstance, string productId, string systemId, Cegid.Lithium.Licensing.Client.Rest.Models.ValidationRequest validationRequest, CancellationToken cancellationToken = default);

public RestServiceResult<Cegid.Lithium.Licensing.Client.Rest.Models.ValidationOperationResult> Validate(string workspace, string organization, string appInstance, string productId, string systemId, Cegid.Lithium.Licensing.Client.Rest.Models.ValidationRequest validationRequest);
Parameters
Parameter Type Description Rules
workspace string The workspace. Required.
organization string The organization. Required.
appInstance string The app instance. Required.
productId string The product identifier. Required.
systemId string The system identifier. Required.
validationRequest Cegid.Lithium.Licensing.Client.Rest.Models.ValidationRequest The validation request. Required.
Returns
Return Type Description
Cegid.Lithium.Licensing.Client.Rest.Models.ValidationOperationResult The validation operation result.
Status Codes
Status Code Description
HttpStatusCode.Ok Success.
HttpStatusCode.BadRequest Failure: the request is invalid.
HttpStatusCode.NotFound Failure: not found.
HttpStatusCode.Conflict Failure: conflict.

The operation will raise RestRequestException for any failure status code. The exception may include a body with an instance of RestProblemDetails depending on the status code.

^ Back to top

Models Classes

Account

Describes an account.

Properties
Property Type Description Rules
Id string Gets or sets the identifier. Required.
Key string Gets or sets the key. Required.
Name string Gets or sets the name. Required.
Active bool A value indicating account active. Required.
Managers System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.AccountManager> Gets or sets the managers. Required.
Customer Cegid.Lithium.Licensing.Client.Rest.Models.Customer Gets or sets the customer. Required.

^ Back to top

AccountManager

Describes an account manager.

Properties
Property Type Description Rules
Id string Gets or sets the identifier. Required.
Active bool A value indicating account manager active. Required.

^ Back to top

AppInstanceContext

Describes an app instance context.

Properties
Property Type Description Rules
WorkspaceKey string Gets or sets the workspace key. Required.
OrganizationKey string Gets or sets the organization key. Required.
AppInstanceKey string Gets or sets the app instance key. Required.
ClientId string Gets or sets the client identifier. Required.
AppDefinitionKey string Gets or sets the app definition key. Required.

^ Back to top

Customer

Describes a customer.

Properties
Property Type Description Rules
CISReference string Gets or sets the cis reference. Required.
Description string Gets or sets the description. Required.
CurrencyCode string Gets or sets the currency code. Required.
CountryCode string Gets or sets the country code. Required.
VatNumber string Gets or sets the vat number. Required.
Email string Gets or sets the email. Required.
Telephone string Gets or sets the telephone. Required.
Mobile string Gets or sets the mobile. Required.
Fax string Gets or sets the fax. Required.
City string Gets or sets the city. Required.
PostalCode string Gets or sets the postal code. Required.
StreetName string Gets or sets the street name. Required.
BuildingNumber string Gets or sets the building number. Required.

^ Back to top

Grant

Describes a grant.

Properties
Property Type Description Rules
Id string Gets or sets the identifier. Required.
Timestamp string Gets or sets the timestamp. Required.
AccountKey string Gets or sets the account key. Required.
SubscriptionAlias string Gets or sets the subscription alias. Required.
ProductId string Gets or sets the product identifier. Required.
SystemId string Gets or sets the system identifier. Required.
Hash string Gets or sets the hash. Required.

^ Back to top

Instance

Describes an instance.

Properties
Property Type Description Rules
AccountKey string Gets or sets the account key. Required.
SubscriptionAlias string Gets or sets the subscription alias. Required.
SystemId string Gets or sets the system identifier. Required.
PublicKey string Gets or sets the public key. Required.
PrivateKey string Gets or sets the private key. Required.
ClientId string Gets or sets the client identifier. Required.
ClientSecret string Gets or sets the client secret. Required.
IsActive bool A value indicating instance active. Required.
LastValidationOn System.DateTimeOffset? Gets or sets the last validation on.
Timestamp System.DateTimeOffset? Gets or sets the timestamp.
DeactivatedOn System.DateTimeOffset? Gets or sets the deactivated on.
LicensingHash string Gets or sets the licensing hash. Required.
Properties System.Collections.Generic.IDictionary<string, string> Gets or sets the properties. Required.Not empty.

^ Back to top

Licensee

Describes a licensee.

Properties
Property Type Description Rules
Item string Gets or sets the item. Required.
RegisteredTo string Gets or sets the registered to. Required.
Properties System.Collections.Generic.IDictionary<string, string>? Gets or sets the properties.

^ Back to top

LicensingError

Describes a licensing error.

Properties
Property Type Description Rules
ErrorSource string Gets or sets the error source. Required.
ErrorCode Cegid.Lithium.Licensing.Client.Rest.Models.ErrorCode Gets or sets the error code. Required.
ErrorDescription string Gets or sets the error description. Required.
Properties System.Collections.Generic.IDictionary<string, string> Gets or sets the properties. Required.Not empty.

^ Back to top

LicensingWarning

Describes a licensing warning.

Properties
Property Type Description Rules
WarningSource string Gets or sets the warning source. Required.
WarningCode Cegid.Lithium.Licensing.Client.Rest.Models.WarningCode Gets or sets the warning code. Required.
WarningDescription string Gets or sets the warning description. Required.

^ Back to top

ModelWithProperties

Describes a model with properties.

Properties
Property Type Description Rules
Properties System.Collections.Generic.IDictionary<string, string> Gets or sets the properties. Required.Not empty.

^ Back to top

RegisterOperationResult

Describes a register operation result.

Properties
Property Type Description Rules
Success bool A value indicating register operation success. Required.
ErrorCode int Gets or sets the error code. Required.
ErrorDescription string Gets or sets the error description. Required.
RegistrationHash string Gets or sets the registration hash. Required.
Errors System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.LicensingError> Gets or sets the errors. Required.
Warnings System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.LicensingWarning> Gets or sets the warnings. Required.

^ Back to top

RegistrationRequest

Describes a registration request.

Properties
Property Type Description Rules
Hash string Gets or sets the hash. Required.
Licensees System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.Licensee> Gets or sets the licensees. Required.

^ Back to top

Solution

Describes a solution.

Properties
Property Type Description Rules
Id string Gets or sets the identifier. Required.
Key string Gets or sets the key. Required.
Description string Gets or sets the description. Required.

^ Back to top

Subscription

Describes a subscription.

Properties
Property Type Description Rules
Id string Gets or sets the identifier. Required.
Solution Cegid.Lithium.Licensing.Client.Rest.Models.Solution Gets or sets the solution. Required.
Parameters System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.SubscriptionParameter> Gets or sets the parameters. Required.
Account Cegid.Lithium.Licensing.Client.Rest.Models.Account Gets or sets the account. Required.
Users System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.SubscriptionUser> Gets or sets the users. Required.
StartDate System.DateTimeOffset? Gets or sets the start date.
EndDate System.DateTimeOffset? Gets or sets the end date.
ClientId string Gets or sets the client identifier. Required.
ClientSecret string Gets or sets the client secret. Required.
State int Gets or sets the state. Required.
Alias string Gets or sets the alias. Required.
Scopes string Gets or sets the scopes. Required.
OwnerSubscriptionId string Gets or sets the owner subscription identifier. Required.

^ Back to top

SubscriptionInfo

Describes a subscription.

Properties
Property Type Description Rules
Id string Gets or sets the identifier. Required.
Alias string Gets or sets the alias. Required.
Account string Gets or sets the account. Required.
Description string Gets or sets the description. Required.
State string Gets or sets the state. Required.

^ Back to top

SubscriptionInfoList

Describes a subscription info list.

Properties
Property Type Description Rules
Subscriptions System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.SubscriptionInfo> Gets or sets the subscriptions. Required.

^ Back to top

SubscriptionInstance

Describes a subscription instance.

Properties
Property Type Description Rules
AccountKey string Gets or sets the account key. Required.
SubscriptionAlias string Gets or sets the subscription alias. Required.
SystemId string Gets or sets the system identifier. Required.
IsActive bool A value indicating subscription instance active. Required.
LastValidationOn System.DateTimeOffset? Gets or sets the last validation on.
DeactivatedOn System.DateTimeOffset? Gets or sets the deactivated on.
Licensees System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.Licensee> Gets or sets the licensees. Required.
Properties System.Collections.Generic.IDictionary<string, string> Gets or sets the properties. Required.Not empty.

^ Back to top

SubscriptionInstancesOperationResult

Describes a subscription instances operation result.

Properties
Property Type Description Rules
Instances System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.SubscriptionInstance> Gets or sets the instances. Required.
Properties System.Collections.Generic.IDictionary<string, string> Gets or sets the properties. Required.Not empty.

^ Back to top

SubscriptionParameter

Describes a subscription parameter.

Properties
Property Type Description Rules
Parameter string Gets or sets the parameter. Required.
Value string Gets or sets the value. Required.

^ Back to top

SubscriptionUser

Describes a subscription user.

Properties
Property Type Description Rules
Id string Gets or sets the identifier. Required.
Role Cegid.Lithium.Licensing.Client.Rest.Models.SubscriptionUserRole Gets or sets the role. Required.
Active bool A value indicating subscription user active. Required.

^ Back to top

ValidationOperationResult

Describes a validation operation result.

Properties
Property Type Description Rules
Success bool A value indicating validation operation success. Required.
RegistrationHash string Gets or sets the registration hash. Required.
ErrorCode int Gets or sets the error code. Required.
ErrorDescription string Gets or sets the error description. Required.
Errors System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.LicensingError> Gets or sets the errors. Required.
Warnings System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.LicensingWarning> Gets or sets the warnings. Required.
Properties System.Collections.Generic.IDictionary<string, string> Gets or sets the properties. Required.Not empty.

^ Back to top

ValidationRequest

Describes a validation request.

Properties
Property Type Description Rules
LicenseesHash string Gets or sets the licensees hash. Required.
RegistrationHash string Gets or sets the registration hash. Required.

^ Back to top

ValidationResult

Describes a validation result.

Properties
Property Type Description Rules
Errors System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.LicensingError> Gets or sets the errors. Required.
Warnings System.Collections.Generic.IList<Cegid.Lithium.Licensing.Client.Rest.Models.LicensingWarning> Gets or sets the warnings. Required.
Properties System.Collections.Generic.IDictionary<string, string> Gets or sets the properties. Required.Not empty.

^ Back to top

Enumerations Classes

ErrorCode

Error codes used in licensing error messages.

Members
Member Value Description
None 0 Not for use.
IValidLicensingServiceError 1 An error has occured while executing license validation.
IValidRegistrationService 2 An error has occured while executing license registration.
RegistrationExists 100 Cannot register a new licensee because there is already an existing registration for the specified subscription.
UserNotManager 101 The user is not manager.
DuplicatedEntries 102 Duplicated entries where detected in RegistrationRequest.Licensees.
ExcessEntries 103 Number of entries for Licensee.Item exceeds the number of allowed entries by the subscription.
ExcessEntriesInSubscriptionInstances 104 Number of entries in all subscription instances for Licensee.Item exceeds the number of allowed entries by the subscription.
ItemNotFoundInSubscription 105 The Licensee.Item was not found in te subscription.
EndDateForItemExpired 106 The end date for Licensee.Item subscription has been reached.
InvalidCsaEndDate 107 The csa end date is inavalid.
HashValuesDoNotMatch 200 The hash values do not match.
InvalidRegistrationHash 201 Unable to decrypt content.
SubscriptionEnded 300 The subscription end date has passed.

^ Back to top

SubscriptionUserRole

The types of roles for the users.

Members
Member Value Description
Manager 0 A PRIMAVERA Identity user.
Application 1 A PRIMAVERA Identity clientId application.
Other 2 Other types of roles.

^ Back to top

WarningCode

Possible licensing warnning codes.

Members
Member Value Description
SubscriptionEnding 0 Product subscription is about to end. Check subscription details for more information.
SubscriptionCsaNotFound 202 The csa subscription was not found.

^ Back to top