GET /digitalLicense/validate

How did we do?

Validate that the current user account owns a digitial license to a product.

Outline

Validates that the current user account owns a digital license to a product. This method will return a not found error if the digital license never existed, or if the digital license exists but is currently revoked. This method will only return a success code if the user has a valid, non-revoked digital license for the product.

Request

HTTP request

GET https://sessions-api.hivemp.com/v1/digitalLicense/validate?productId=productId

You must replace the emphasized parameter values when making the request. Refer to the parameters section below.

Access policies

This method can only be called with certain kinds of API keys. The API key types that are permitted to call this API are:

Additional restrictions may apply to some of the API key types listed above; refer to the method description for any additional restrictions.

Authorization

All HiveMP REST APIs require the presence of an X-API-Key header with an appropriate value, depending on the access policies outlined above.

This method requires a valid API key to be passed on request, as demonstrated in the following example:

X-API-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Parameters

productId Description The product to check a digital license for.
Type string
Specified In query
Required? Yes

Request body

The request body must be empty.

Response

This method will return one of the following responses:

200 Description Success
Type UserAccountDigitalLicense
... Description An error occurred; check the value error code and message of the response
Type HiveMPSystemError

Code Snippets

curl -s \
  -H "X-API-Key: $apiKey" \
  -H "Accept: application/json" \
  -H "Content-Length: 0" \
  -X GET \
  "https://user-session-api.hivemp.com/v1/digitalLicense/validate"\
"?productId=$productId"
// At the top of your script.
using HiveMP.Api;
using HiveMP.UserSession.Api;

// Inside your MonoBehaviour. Callbacks automatically happen on the main thread
// via Unity's coroutine infrastructure.
var client = new DigitalLicenseClient("<YOUR API KEY HERE>");
client.DigitalLicenseValidateGETPromise(new DigitalLicenseValidateGETRequest
    {
        ProductId = "...",
    },
    result =>
    {
        // result is an UserAccountDigitalLicense
    },
    ex =>
    {
        // HiveMP exception properties:
        // - ex.HttpStatusCode: The HTTP status code of the response
        // - ex.HiveErrorCode: The HiveMP error code
        // - ex.HiveErrorMessage: The HiveMP error message
        // - ex.HiveErrorFields: Arbitrary extra data associated with the error
    });
// Add to your namespaces.
using HiveMP.Api;
using HiveMP.UserSession.Api;

// Call this inside an async method.
var client = new DigitalLicenseClient("<YOUR API KEY HERE>");
try
{
    var result = await client.DigitalLicenseValidateGETAsync(new DigitalLicenseValidateGETRequest
        {
            ProductId = "...",
        });
    
// result is an UserAccountDigitalLicense } catch (HiveMPException ex) { // HiveMP exception properties: // - ex.HttpStatusCode: The HTTP status code of the response // - ex.HiveErrorCode: The HiveMP error code // - ex.HiveErrorMessage: The HiveMP error message // - ex.HiveErrorFields: Arbitrary extra data associated with the error }
# Copy the text below into a Blueprints window
# inside the UE4 editor anywhere to create the node for
# this API call.
Begin Object Class=/Script/OnlineBlueprintSupport.K2Node_LatentOnlineCall Name="K2Node_LatentOnlineCall_0"
   ProxyFactoryFunctionName="PerformHiveCall"
   ProxyFactoryClass=Class'/Script/HiveMPSDK.sessions_DigitalLicense_'
   ProxyClass=Class'/Script/HiveMPSDK.sessions_DigitalLicense_'
End Object

Try this API

The API key to use for the request.

The product to check a digital license for.