Visitor Prioritization API Resources

The Visitor Prioritization API enables you to manage your Visitor Prioritization policy.

NOTE: If you are new to Visitor Prioritization, please use the Cloudlets OPEN API instead. The Cloudlets OPEN API supports all Cloudlets. The Visitor Prioritization API is deprecated.

API Summary

Operation Method Endpoint
Policies
List Policies POST /config-visitor-prioritization-data/api/v1/policymanager?command=getAllPolicyInfoMaps
Create a Policy POST /config-visitor-prioritization-data/api/v1/policymanager?command=create
Get a Policy POST /config-visitor-prioritization-data/api/v1/policymanager?command=read
Modify a Policy POST /config-visitor-prioritization-data/api/v1/policymanager?command=update
List Policy Information POST /config-visitor-prioritization-data/api/v1/policymanager?command=getPolicyInfoList
Clone a Policy POST /config-visitor-prioritization-data/api/v1/policymanager?command=clone
Policy Activations
Activate a Policy POST /config-visitor-prioritization-data/api/v1/policymanager
List Policy Activations GET /config-visitor-prioritization-data/api/v1/common/activation{?historyOnly}

List Policies

Gets useful information about all policies.

POST /config-visitor-prioritization-data/api/v1/policymanager?command=getAllPolicyInfoMaps

Content-Type: application/x-www-form-urlencoded

Request:

query=%7B%22policyManagerRequest%22%3A+%7B%22command%22%3A%22getPolicyInfoMapUsingACGIDs%22%2C%22getPolicyInfoMapUsingACGIDs%22%3A+%7B%7D%7D%7D

Parameter Type Sample Description
Required
command Enumeration getAllPolicyInfoMaps Command that enables this API operation. Possible values: clone, create, getAllPolicyInfoMaps, getPolicyInfoList, read, update.

Status 200 application/json

Response:

{
    "responseCode": 0,
    "response": [
        {
            "id": 102,
            "policyId": 101,
            "createdBy": "username",
            "createDate": 1399880615407,
            "acgId": "3-10TQKCS",
            "version": 1,
            "immutable": false,
            "activatedProduction": 0,
            "activatedStaging": 0,
            "activatedTest": 0,
            "description": null,
            "policyName": "username_test",
            "assetId": 0,
            "cloudletId": 1,
            "cloudletConfig": {
                "id": 1,
                "key": "VP",
                "name": "VISITORPRIORITIZATION",
                "featureKey": "visitor_prioritization",
                "engProduct": "Cloudlets::Visitor_Prioritization",
                "policyFileNamePrefix": "nimbus_",
                "openAPIContextRoot": "/configure-visitor-prioritization-data",
                "isInternal": false,
                "stagingLocation": null,
                "productionLocation": null,
                "logsLocation": null
            },
            "policyDescription": "Test description.",
            "policyCreatedBy": "username",
            "policyLastModifiedBy": "username",
            "policyCreateDate": 1399880598512,
            "policyLastModifiedDate": 1399880615407,
            "matchRules": null
        }
    ],
    "i18nCode": 0,
    "englishMessage": null
}

Create a Policy

Create a new Visitor Prioritization policy.

POST /config-visitor-prioritization-data/api/v1/policymanager?command=create

Content-Type: application/x-www-form-urlencoded

Request:

query=%7B%22policyManagerRequest%22%3A%7B%22command%22%3A%22create%22%2C%22create%22%3A%7B%22cloudletId%22%3A%221%22%2C%22policyName%22%3A%22TestPolicy3%22%2C%22policyDescription%22%3A%22TestPolicy3+notes.%22%7D%7D%7D

Parameter Type Sample Description
Required
command Enumeration create Command that enables this API operation. Possible values: clone, create, getAllPolicyInfoMaps, getPolicyInfoList, read, update.

Status 200 application/json

Response:

{
    "responseCode": 0,
    "response": [
        {
            "id": 436,
            "policyId": 1001,
            "createdBy": "cloudlets",
            "createDate": 1400601368151,
            "acgId": "3-10TQKCS",
            "version": 2,
            "immutable": false,
            "activatedProduction": 0,
            "activatedStaging": 0,
            "activatedTest": 0,
            "description": "Description for all policy versions",
            "policyName": "Test1",
            "assetId": 0,
            "cloudletId": 1,
            "cloudletConfig": {},
            "policyDescription": null,
            "policyCreatedBy": "cloudlets",
            "policyLastModifiedBy": "cloudlets",
            "policyCreateDate": 1400535431324,
            "policyLastModifiedDate": 1400601173283,
            "matchRules": null
        }
    ],
    "i18nCode": 0,
    "englishMessage": null
}

Get a Policy

List the configuration of a policy version.

The rule configuration information is listed in the matchRules field of the response JSON.

POST /config-visitor-prioritization-data/api/v1/policymanager?command=read

Content-Type: application/x-www-form-urlencoded

Request:

query=%7B%22policyManagerRequest%22%3A%7B%22command%22%3A%22read%22%2C%22read%22%3A%7B%22id%22%3A%221133%22%7D%7D%7D

Parameter Type Sample Description
Required
command Enumeration read Command that enables this API operation. Possible values: clone, create, getAllPolicyInfoMaps, getPolicyInfoList, read, update.

Status 200 application/json

Response:

{
    "responseCode": 0,
    "response": {
        "id": 1133,
        "policyId": 686,
        "createdBy": "cloudlets",
        "createDate": 1407339219183,
        "acgId": "3-10TQKCS",
        "version": 1,
        "immutable": false,
        "activatedProduction": 0,
        "activatedStaging": 0,
        "activatedTest": 0,
        "description": "Default description for all versions",
        "policyName": "1ERPolicy",
        "assetId": 0,
        "cloudletId": 1,
        "cloudletConfig": {
            "id": 0,
            "key": "VP",
            "name": "VISITORPRIORITIZATION",
            "featureKey": "visitor_prioritization",
            "engProduct": "Cloudlets::Visitor_Prioritization",
            "policyFileNamePrefix": "nimbus_",
            "openAPIContextRoot": "/config-visitor-prioritization-data",
            "isInternal": true,
            "stagingLocation": "tapioca_staging_ump_files",
            "productionLocation": "tapioca_ump_files",
            "logsLocation": null
        },
        "policyDescription": "Sample Description",
        "policyCreatedBy": "cloudlets",
        "policyLastModifiedBy": "cloudlets",
        "policyCreateDate": 1407160924865,
        "policyLastModifiedDate": 1407339219183,
        "matchRules": [
            {
                "type": "vpMatchRule",
                "end": 0,
                "id": 0,
                "matchURL": null,
                "matches": [
                    {
                        "caseSensitive": false,
                        "matchOperator": "contains",
                        "matchType": "protocol",
                        "matchValue": "http",
                        "negate": false
                    },
                    {
                        "caseSensitive": false,
                        "matchOperator": "contains",
                        "matchType": "hostname",
                        "matchValue": "source.com",
                        "negate": false
                    },
                    {
                        "caseSensitive": false,
                        "matchOperator": "contains",
                        "matchType": "query",
                        "matchValue": "test=null",
                        "negate": false
                    }
                ],
                "name": "rule 1",
                "start": 0,
                "useIncomingQueryString": false
            }
        ]
    },
    "i18nCode": 0,
    "englishMessage": null
}

Modify a Policy

Make updates to a Visitor Prioritization policy.

NOTE: The response contains a new ID and other fields that were updated by the server.

POST /config-visitor-prioritization-data/api/v1/policymanager?command=update

Content-Type: application/x-www-form-urlencoded

Request:

query=%7B%22policyManagerRequest%22%3A%7B%22command%22%3A%22update%22%2C%22update%22%3A%7B%22overwriteRules%22%3Atrue%2C%22id%22%3A435%2C%22policyId%22%3A122%2C%22createdBy%22%3A%22cloudlets%22%2C%22createDate%22%3A1400782263395%2C%22version%22%3A10%2C%22immutable%22%3Afalse%2C%22activatedProduction%22%3A0%2C%22activatedStaging%22%3A0%2C%22activatedTest%22%3A0%2C%22description%22%3A%22Save+a+new+version%22%2C%22policyName%22%3A%2214_3VP_Policy%22%2C%22assetId%22%3A0%2C%22cloudletId%22%3A1%2C%22cloudletConfig%22%3A%7B%7D%2C%22policyDescription%22%3A%22specific+version+description%22%2C%22policyCreatedBy%22%3A%22username%22%2C%22policyLastModifiedBy%22%3A%22cloudlets%22%2C%22policyCreateDate%22%3A1399997852450%2C%22policyLastModifiedDate%22%3A1400782263395%2C%22matchRules%22%3A%5B%7B%22type%22%3A%22vpMatchRule%22%2C%22end%22%3A0%2C%22passThroughPercent%22%3A50%2C%22id%22%3A0%2C%22matchURL%22%3A%22HTTP%3A%2F%2Fakamai.com%2FsourceURL%2Fupdate%22%2C%22name%22%3A%22rule+1%22%2C%22start%22%3A0%2C%22useIncomingQueryString%22%3Atrue%7D%5D%7D%7D%7D

Parameter Type Sample Description
Required
command Enumeration update Command that enables this API operation. Possible values: clone, create, getAllPolicyInfoMaps, getPolicyInfoList, read, update.

Status 200 application/json

Response:

{
    "responseCode": 0,
    "response": {
        "id": 436,
        "policyId": 1001,
        "createdBy": "cloudlets",
        "createDate": 1400782263395,
        "acgId": "3-10TQKCS",
        "version": 10,
        "immutable": false,
        "activatedProduction": 0,
        "activatedStaging": 0,
        "activatedTest": 0,
        "description": "Save a new version",
        "policyName": "14_3VP_Policy",
        "assetId": 0,
        "cloudletId": 1,
        "cloudletConfig": {},
        "policyDescription": "specific version description",
        "policyCreatedBy": "username",
        "policyLastModifiedBy": "username2",
        "policyCreateDate": 1399997852450,
        "policyLastModifiedDate": 1400782263395,
        "matchRules": [
            {
                "type": "vpMatchRule",
                "end": 0,
                "id": 0,
                "passThroughPercent": 0.05,
                "matchURL": null,
                "matches": [
                    {
                        "caseSensitive": false,
                        "matchOperator": "contains",
                        "matchType": "protocol",
                        "matchValue": "HTTP",
                        "negate": false
                    },
                    {
                        "caseSensitive": false,
                        "matchOperator": "contains",
                        "matchType": "hostname",
                        "matchValue": "test.akamai.com",
                        "negate": false
                    },
                    {
                        "caseSensitive": false,
                        "matchOperator": "contains",
                        "matchType": "path",
                        "matchValue": "/sourceURL",
                        "negate": false
                    }
                ],
                "name": "rule 1",
                "start": 0,
                "useIncomingQueryString": true
            }
        ]
    },
    "i18nCode": 0,
    "englishMessage": null
}

List Policy Information

List all information about each policy version, except for the matchRules.

POST /config-visitor-prioritization-data/api/v1/policymanager?command=getPolicyInfoList

Content-Type: application/x-www-form-urlencoded

Request:

query=%7B%22policyManagerRequest%22%3A%7B%22command%22%3A%22getPolicyInfoList%22%2C%22getPolicyInfoList%22%3A%7B%22policyId%22%3A%22243%22%7D%7D%7D

Parameter Type Sample Description
Required
command Enumeration getPolicyInfoList Command that enables this API operation. Possible values: clone, create, getAllPolicyInfoMaps, getPolicyInfoList, read, update.

Status 200 application/json

Response:

{
    "responseCode": 0,
    "response": [
        {
            "id": 351,
            "policyId": 243,
            "createdBy": "ccare2",
            "createDate": 1403050992316,
            "acgId": "3-10TQKCS",
            "version": 1,
            "immutable": false,
            "activatedProduction": 0,
            "activatedStaging": 0,
            "activatedTest": 0,
            "description": null,
            "policyName": "Test_VP_Policy",
            "assetId": 0,
            "cloudletId": 1,
            "cloudletConfig": {
                "id": 0,
                "key": "VP",
                "name": "VISITORPRIORITIZATION",
                "featureKey": "visitor_prioritization",
                "engProduct": "Cloudlets::Visitor_Prioritization",
                "policyFileNamePrefix": "nimbus_",
                "openAPIContextRoot": "/config-visitor-prioritization-data",
                "isInternal": true,
                "stagingLocation": "tapioca_staging_ump_files",
                "productionLocation": "tapioca_ump_files",
                "logsLocation": null
            },
            "policyDescription": null,
            "policyCreatedBy": "cloudletsuser",
            "policyLastModifiedBy": "testuser2",
            "policyCreateDate": 1403036738153,
            "policyLastModifiedDate": 1405438191162,
            "matchRules": null
        }
    ],
    "i18nCode": 0,
    "englishMessage": null
}

Clone a Policy

Make a copy of an existing policy version.

NOTE: The new policy version will receive the next available version number.

POST /config-visitor-prioritization-data/api/v1/policymanager?command=clone

Content-Type: application/x-www-form-urlencoded

Request:

query=%7B%22policyManagerRequest%22%3A%7B%22command%22%3A%22clone%22%2C%22clone%22%3A%7B%22id%22%3A%221149%22%7D%7D%7D

Parameter Type Sample Description
Required
command Enumeration clone Command that enables this API operation. Possible values: clone, create, getAllPolicyInfoMaps, getPolicyInfoList, read, update.

Status 200 application/json

Response:

{
    "responseCode": 0,
    "response": {
        "id": 1178,
        "policyId": 764,
        "createdBy": "cloudlets",
        "createDate": 1407352490414,
        "acgId": "3-10TQKCS",
        "version": 5,
        "immutable": false,
        "activatedProduction": 0,
        "activatedStaging": 0,
        "activatedTest": 0,
        "description": null,
        "policyName": "TestPolicy3",
        "assetId": 0,
        "cloudletId": 1,
        "cloudletConfig": null,
        "policyDescription": "TestPolicy3 notes.",
        "policyCreatedBy": "cloudlets",
        "policyLastModifiedBy": "cloudlets",
        "policyCreateDate": 1407348215182,
        "policyLastModifiedDate": 1407348215182,
        "matchRules": null
    },
    "i18nCode": 0,
    "englishMessage": null
}

Activate a Policy

Activate a specified Cloudlet policy.

Note the following before using this operation:

  • You must first run the List Policy Activations operation in order to get the correct arlId (fileId).

  • The policyVersionId corresponds to the tapiocaIDs. When running this operation, make sure you are activating the correct version. The sample request uses tapiocaIDs (policyVersionId) 3668, which is version 1.

  • The generated policy file will be propagated to the selected environment. After activation completes, the policy will be available for use.

POST /config-visitor-prioritization-data/api/v1/policymanager

Content-Type: application/x-www-form-urlencoded

Request:

query=%7B%22policyManagerRequest%22%3A%7B%22command%22%3A%22activate%22%2C%22activate%22%3A%7B%22tapiocaIDs%22%3A%5B3668%5D%2C%22arlId%22%3A%22217315%22%2C%22assetId%22%3A%220%22%2C%22network%22%3A%22staging%22%7D%7D%7D

Status 200 application/json

Response:

{
    "responseCode": 0,
    "response": null,
    "i18nCode": 0,
    "englishMessage": null
}

List Policy Activations

List policies and provide policy-specific activation information.

NOTE: During activation you will need the fileId, which corresponds to the arlId.

GET /config-visitor-prioritization-data/api/v1/common/activation{?historyOnly}

Example: /config-visitor-prioritization-data/api/v1/common/activation?historyOnly=false

Parameter Type Sample Description
Optional
historyOnly Boolean false When enabled, include only the history, otherwise also provide policies available for activation.

Status 200 application/json

Response:

[
{
    "version": "2",
    "activatedPolicyVersions": [
        {
            "stageStatus": "3000",
            "productionLastUpdated": null,
            "stageLastUpdated": 1415297386000,
            "policies": [
                {
                    "policyName": "TestPolicyv1",
                    "cloudletId": 0,
                    "versions": [
                        {
                            "version": "1",
                            "policyVersionId": 3668,
                            "acgId": "3-10TAKCB"
                        }
                    ],
                    "id": 2501
                }
            ],
            "productionStatus": null,
            "fileId": 217315,
            "createdBy": "tester",
            "assetId": 0,
            "propertyName": "tester.akamai.com",
            "id": 1421,
            "type": "ump"
        }
    ],
...


Last modified: 12/12/2016