NAV Navbar

Introduction

The IBM Planning Analytics Content Services API can be used to create, retrieve, delete, or update assets in IBM Planning Analytics Workspace.

Headers

To use the Planning Analytics Content Services API, include the following headers in your requests.

Content-Type

Use application/json when making requests to the Planning Analytics Content Services API.

ba-sso-authenticity

The ba-sso-authenticity is the Business Analytics single sign-on authentication value. The value can be found in your cookies, under the name ba-sso-csrf.

The cookie is the client-side cookie for Planning Analytics Workspace. Cookies must be defined, otherwise your request will not be authenticated. You can use a javascript file to redirect you to the login page. After you log in, your cookies will be set in the browser.

The value can be found in your cookies, by combining wa-current-userid, ba-sso-csrf and paSession.

For example:

wa-current-userid=N9UFBGNPY8HO; ba-sso-csrf=Y7YjUGVYot+5eZZW9KFyqnMXa0s=; paSession=s%3A2wglGfmeBaX4CIawGqRSO1aUTDrs4ytD.dH7HqmL8uhH%2B%2Bz4jq6zVkaxGlZ1%2FMWQVBBqHllu3wJY

Example:

{
    "type": "dashboard",
    "name": "example_name",
    "path": "/shared",
    "content": {
        "example_content": "content"
    },
    "custom_properties": {
        "score": 100
    }
}

The Planning Analytics Content Service API accepts and returns requests in JSON. You can use the following parameters when sending POST and PUT requests.

Parameter name Description
type The asset type.
name The asset name.
path The asset path.
content The content property of the asset that you want to add or modify. The content parameter can be expanded to reveal an array of nested parameters in an asset. You can add or modify the parameters in this array. Parameters in the content property may differ between asset types.
custom_properties The custom_properties property of the asset that you want to add or modify. You can use custom_properties for any custom values that you would like to store in the asset.

Supported OData query options

The Planning Analytics Content Services API supports several OData query options. These query options can be used to refine your requests.

$expand

You can use $expand to expand a folder asset. If you have a folder asset and you want to read the children assets of that folder, $expand will return the children assets of that folder.

The $expand option can also be used if you want to view the contents of an asset, such as a dashboard.

For example, http://localhost:1338/pacontent/v1/Assets('94d80e2b-8285-4926-9d37-08f5f32f9b68')?$expand=content expands and returns the content property from the asset.

$filter

You can use $filter with an operator to filter the retrieved JSON properties. $filter can be used only with $expand for expanded assets.

For example, $filter=name eq finance returns only assets with finance in the name property.

http://localhost:1338/pacontent/v1/Assets(path='%252fshared%252fdemo')?$expand=Assets($expand=content;$filter=name eq 'demo') filters the expanded content based on if the asset contains a name property that is equal to the demo value.

$select

You can use $select to select an asset with a certain property in your requests. The $select option can be used with $expand and in the URL query.

For example, $select=name returns only assets with the name property.

$top

You can use $top to define the number of assets that you want returned, when returning an array.

For example, $top=10 returns the first 10 assets in an array.

$skip

You can use $skip to define the number of assets to skip when an array of assets is returned from within a folder.

For example, $skip=3 skips the first 3 assets in an array.

$orderby

You can use $orderby to define how you want your assets to be ordered when an array is returned.

For example, $orderby=name orders the returned assets by the name property and alphabetically.

Operators

The following are operators that you can use with the $filter and $select options:

Operator Description
eq The eq operator returns true if the left operand is equal to the right operand, otherwise it returns false.
ne The ne operator returns true if the left operand is not equal to the right operand, otherwise it returns false.
gt The gt operator returns true if the left operand is greater than the right operand, otherwise it returns false.
ge The ge operator returns true if the left operand is greater than or equal to the right operand, otherwise it returns false.
lt The lt operator returns true if the left operand is less than the right operand, otherwise it returns false.
le The le operator returns true if the left operand is less than or equal to the right operand, otherwise it returns false.
and The and operator returns true if both the left and right operands evaluate to true, otherwise it returns false.

POST requests

You can use POST requests to send data to the Planning Analytics server and create assets in Planning Analytics Workspace.

Creating a folder

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets

You can use a POST request to create a new folder in a path that you define.

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.

Body

Example of the JSON request body

{
    "type": "folder",
    "path": "/shared",
    "name": "demo"
}

In this example, the request is using the following keys:

Key name Description
type The type of asset that you want to create.
path The path where you want your asset to be created in.
name The name that you want to give your asset.

Result

Example of a response from a successful request

{
    "@odata.context": "http://localhost:1338/v1/$metadata#Assets/$entity",
    "@odata.id": "http://localhost:1338/v1/Assets('46aabf88-bdf2-4b1d-a150-00e31ef804ea')",
    "@odata.editLink": "localhost:1338/v1/Assets('46aabf88-bdf2-4b1d-a150-00e31ef804ea')",
    "id": "46aabf88-bdf2-4b1d-a150-00e31ef804ea",
    "description": "",
    "name": "demo",
    "path": "/shared/demo",
    "type": "folder",
    "kind": "c#info",
    "state": "valid",
    "version": 0,
    "system_properties": {
        "created_date": "2020-05-12T18:54:40.472Z",
        "created_user_id": "5d39c9bbe4b0e222859a1452",
        "created_user_pretty_name": "Admin",
        "modified_date": "2020-05-12T18:54:40.472Z",
        "modified_user_id": "5d39c9bbe4b0e222859a1452",
        "modified_user_pretty_name": "Admin",
        "used_date": "2020-05-12T18:54:40.472Z",
        "used_user_id": "5d39c9bbe4b0e222859a1452",
        "used_user_pretty_name": "Admin",
        "permissions": [
            "list",
            "open",
            "write",
            "manage",
            "secure"
        ]
    },
    "dynamic_properties": {
        "delete_link": "idvisualizations/c/v2/content/folder/46aabf88-bdf2-4b1d-a150-00e31ef804ea/",
        "thumbnail_link": "idvisualizations/c/v2/attachment/folder/46aabf88-bdf2-4b1d-a150-00e31ef804ea/?name=thumbnail"
    },
    "custom_properties": {}
}

A new folder is created.

Creating a dashboard

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets

You can use a POST request to create a new dashboard in a path that you define.

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets

Body

Example of the JSON request body

{
    "type": "dashboard",
    "name": "demo",
    "path": "/shared",
    "content": {
        "version": "6.0",
        "container": "C",
        "useSpec": [],
        "dataSource": [],
        "querySubject": [],
        "filter": [],
        "calculation": []
    }
}

In this example, the request is using the following keys:

Key name Description
type The type of asset that you want to create.
path The path where you want your asset to be created in.
name The name that you want to give your asset.
content The specifications for the asset that you are creating.

Result

Example of a response from a successful request

{
    "@odata.context": "http://localhost:1338/v1/$metadata#Assets/$entity",
    "@odata.id": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
    "@odata.editLink": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
    "id": "0985d8bf-6fb2-42d8-a31d-5a312f43e18c",
    "description": "",
    "name": "demo",
    "path": "/shared/demo",
    "type": "dashboard",
    "kind": "c#info",
    "state": "valid",
    "version": 0,
    "system_properties": {
        "created_date": "2020-05-12T19:02:37.414Z",
        "created_user_id": "5d39c9bbe4b0e222859a1452",
        "created_user_pretty_name": "Admin",
        "modified_date": "2020-05-12T19:02:37.414Z",
        "modified_user_id": "5d39c9bbe4b0e222859a1452",
        "modified_user_pretty_name": "Admin",
        "used_date": "2020-05-12T19:02:37.414Z",
        "used_user_id": "5d39c9bbe4b0e222859a1452",
        "used_user_pretty_name": "Admin",
        "permissions": [
            "list",
            "open",
            "write",
            "manage",
            "secure"
        ]
    },
    "dynamic_properties": {
        "delete_link": "idvisualizations/c/v2/content/dashboard/0985d8bf-6fb2-42d8-a31d-5a312f43e18c/",
        "thumbnail_link": "idvisualizations/c/v2/attachment/dashboard/0985d8bf-6fb2-42d8-a31d-5a312f43e18c/?name=thumbnail"
    },
    "custom_properties": {}
}

A new dashboard is created.

GET requests

You can use GET requests to retrieve metadata about an asset in Planning Analytics Workspace.

Get asset from an ID

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')

This GET request uses the asset ID to retrieve and return the metadata from the asset from the server.

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets('<asset ID>')

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Asset ID The ID for the asset.

Result

Example of the metadata retrieved

{
    "@odata.context": "http://localhost:1338/v1/$metadata#Assets/$entity",
    "@odata.id": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
    "@odata.editLink": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
    "id": "0985d8bf-6fb2-42d8-a31d-5a312f43e18c",
    "description": "",
    "name": "demo",
    "path": "/shared/demo",
    "type": "dashboard",
    "kind": "c#info",
    "state": "valid",
    "version": 0,
    "system_properties": {
        "created_date": "2020-05-12T19:02:37.414Z",
        "created_user_id": "5d39c9bbe4b0e222859a1452",
        "created_user_pretty_name": "Admin",
        "modified_date": "2020-05-12T19:02:37.414Z",
        "modified_user_id": "5d39c9bbe4b0e222859a1452",
        "modified_user_pretty_name": "Admin",
        "used_date": "2020-05-12T19:02:37.414Z",
        "used_user_id": "5d39c9bbe4b0e222859a1452",
        "used_user_pretty_name": "Admin",
        "permissions": [
            "list",
            "open",
            "write",
            "manage",
            "secure"
        ]
    },
    "dynamic_properties": {
        "delete_link": "idvisualizations/r/v2/content/shared/demo/",
        "thumbnail_link": "idvisualizations/r/v2/attachment/shared/demo/?name=thumbnail"
    },
    "custom_properties": {}
}

The metadata for the asset is returned.

Get asset and expand content from an ID

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')?$expand=content

This GET request uses the asset ID to retrieve the asset metadata and also the content of the asset.

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets('<asset ID>')?$expand=content

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Asset ID The ID for the asset.

Result

Example of the asset metadata and content retrieved

{
    "@odata.context": "http://localhost:1338/v1/$metadata#Assets/$entity",
    "@odata.id": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
    "@odata.editLink": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
    "id": "0985d8bf-6fb2-42d8-a31d-5a312f43e18c",
    "description": "",
    "name": "demo",
    "path": "/shared/demo",
    "type": "dashboard",
    "kind": "c#info",
    "state": "valid",
    "version": 0,
    "system_properties": {
        "created_date": "2020-05-12T19:02:37.414Z",
        "created_user_id": "5d39c9bbe4b0e222859a1452",
        "created_user_pretty_name": "Admin",
        "modified_date": "2020-05-12T19:02:37.414Z",
        "modified_user_id": "5d39c9bbe4b0e222859a1452",
        "modified_user_pretty_name": "Admin",
        "used_date": "2020-05-12T19:02:37.414Z",
        "used_user_id": "5d39c9bbe4b0e222859a1452",
        "used_user_pretty_name": "Admin",
        "permissions": [
            "list",
            "open",
            "write",
            "manage",
            "secure"
        ]
    },
    "dynamic_properties": {
        "delete_link": "idvisualizations/r/v2/content/shared/demo/",
        "thumbnail_link": "idvisualizations/r/v2/attachment/shared/demo/?name=thumbnail"
    },
    "custom_properties": {},
    "content": {
        "container": "C",
        "filter": [],
        "calculation": [],
        "querySubject": [],
        "version": "6.0",
        "dataSource": [],
        "useSpec": []
    }
}

Get asset using a path

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets(path='%252fshared%252fdemo')

This GET requests uses the path of the asset to retrieve asset data. Using the path is useful if you're unsure about what the ID of the asset is.

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets(path='<path of the asset>')

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Asset ID The ID for the asset.
Asset path The path of asset.

Result

Example of the asset retrieved

{
    "@odata.context": "http://localhost:1338/v1/$metadata#Assets/$entity",
    "@odata.id": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
    "@odata.editLink": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
    "id": "0985d8bf-6fb2-42d8-a31d-5a312f43e18c",
    "description": "",
    "name": "demo",
    "path": "/shared/demo",
    "type": "dashboard",
    "kind": "c#info",
    "state": "valid",
    "version": 0,
    "system_properties": {
        "created_date": "2020-05-12T19:02:37.414Z",
        "created_user_id": "5d39c9bbe4b0e222859a1452",
        "created_user_pretty_name": "Admin",
        "modified_date": "2020-05-12T19:02:37.414Z",
        "modified_user_id": "5d39c9bbe4b0e222859a1452",
        "modified_user_pretty_name": "Admin",
        "used_date": "2020-05-12T19:15:36.401Z",
        "used_user_id": "5d39c9bbe4b0e222859a1452",
        "used_user_pretty_name": "Admin",
        "permissions": [
            "list",
            "open",
            "write",
            "manage",
            "secure"
        ]
    },
    "dynamic_properties": {
        "delete_link": "idvisualizations/r/v2/content/shared/demo/",
        "thumbnail_link": "idvisualizations/r/v2/attachment/shared/demo/?name=thumbnail"
    },
    "custom_properties": {}
}

The asset is retrieved using the path of the asset.

Get asset and content using a path

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets(path='shared%252Fdemo')?$expand=content

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets(path='<path of the asset>')?$expand=content

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Asset path The path of asset.

Result

Example of the asset metadata and content retrieved

{
    "@odata.context": "http://localhost:1338/v1/$metadata#Assets/$entity",
    "@odata.id": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
    "@odata.editLink": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
    "id": "0985d8bf-6fb2-42d8-a31d-5a312f43e18c",
    "description": "",
    "name": "demo",
    "path": "/shared/demo",
    "type": "dashboard",
    "kind": "c#info",
    "state": "valid",
    "version": 0,
    "system_properties": {
        "created_date": "2020-05-12T19:02:37.414Z",
        "created_user_id": "5d39c9bbe4b0e222859a1452",
        "created_user_pretty_name": "Admin",
        "modified_date": "2020-05-12T19:02:37.414Z",
        "modified_user_id": "5d39c9bbe4b0e222859a1452",
        "modified_user_pretty_name": "Admin",
        "used_date": "2020-05-12T19:15:36.401Z",
        "used_user_id": "5d39c9bbe4b0e222859a1452",
        "used_user_pretty_name": "Admin",
        "permissions": [
            "list",
            "open",
            "write",
            "manage",
            "secure"
        ]
    },
    "dynamic_properties": {
        "delete_link": "idvisualizations/r/v2/content/shared/demo/",
        "thumbnail_link": "idvisualizations/r/v2/attachment/shared/demo/?name=thumbnail"
    },
    "custom_properties": {},
    "content": {
        "container": "C",
        "filter": [],
        "calculation": [],
        "querySubject": [],
        "version": "6.0",
        "dataSource": [],
        "useSpec": []
    }
}

The asset metadata and content is retrieved using the asset path.

Get assets of a folder

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets(path='%252fshared')/Assets

This GET request retrieves the children assets of a folder.

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets(path='<folder path>')/Assets

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Folder path The path of the folder where your assets are located in.

Result

Example of the assets within a folder being retrieved

{
    "@odata.context": "http://localhost:1338/v1/$metadata#Assets('/shared')/Assets",
    "value": [
       {
            "@odata.id": "http://localhost:1338/v1/Assets('3edf76f6-7b09-40cf-a467-47b8f55eec15')",
            "@odata.editLink": "http://localhost:1338/v1/Assets('3edf76f6-7b09-40cf-a467-47b8f55eec15')",
            "id": "3edf76f6-7b09-40cf-a467-47b8f55eec15",
            "description": "",
            "name": "revenue_2020",
            "path": "/shared/revenue_2020",
            "type": "dashboard",
            "kind": "c#info",
            "state": "valid",
            "version": 0,
            "system_properties": {
                "created_date": "2019-09-19T16:33:12.318Z",
                "created_user_id": "5d39c9bbe4b0e222859a1452",
                "created_user_pretty_name": "Admin",
                "modified_date": "2019-09-19T16:33:12.318Z",
                "modified_user_id": "5d39c9bbe4b0e222859a1452",
                "modified_user_pretty_name": "Admin",
                "used_date": "2020-04-15T13:23:15.889Z",
                "used_user_id": "5d39c9bbe4b0e222859a1452",
                "used_user_pretty_name": "Admin",
                "permissions": [
                    "list",
                    "open",
                    "write",
                    "manage",
                    "secure"
                ]
            },
            "dynamic_properties": {
                "delete_link": "idvisualizations/r/v2/content/shared/yy-empty/",
                "thumbnail_link": "idvisualizations/r/v2/attachment/shared/yy-empty/?name=thumbnail"
            },
            "custom_properties": {}
        },
        {
            "@odata.id": "http://localhost:1338/v1/Assets('1773db5b-972a-424f-a9a5-be49af5ec137')",
            "@odata.editLink": "http://localhost:1338/v1/Assets('1773db5b-972a-424f-a9a5-be49af5ec137')",
            "id": "1773db5b-972a-424f-a9a5-be49af5ec137",
            "description": "",
            "name": "finance_2020",
            "path": "/shared/finance_2020",
            "type": "dashboard",
            "kind": "c#info",
            "state": "valid",
            "version": 0,
            "system_properties": {
                "created_date": "2019-08-08T17:37:31.050Z",
                "created_user_id": "5d39c9bbe4b0e222859a1452",
                "created_user_pretty_name": "Admin",
                "modified_date": "2019-08-08T17:37:31.050Z",
                "modified_user_id": "5d39c9bbe4b0e222859a1452",
                "modified_user_pretty_name": "Admin",
                "used_date": "2020-04-15T14:50:01.768Z",
                "used_user_id": "5d39c9bbe4b0e222859a1452",
                "used_user_pretty_name": "Admin",
                "permissions": [
                    "list",
                    "open",
                    "write",
                    "manage",
                    "secure"
                ]
            },
            "dynamic_properties": {
                "delete_link": "idvisualizations/r/v2/content/shared/yy-plansample/",
                "thumbnail_link": "idvisualizations/r/v2/attachment/shared/yy-plansample/?name=thumbnail"
            },
            "custom_properties": {}
        },
        {
            "@odata.id": "http://localhost:1338/v1/Assets('f6b71c40-ca1b-4a38-b167-8f8fa1359949')",
            "@odata.editLink": "localhost:1338/v1/Assets('f6b71c40-ca1b-4a38-b167-8f8fa1359949')",
            "id": "f6b71c40-ca1b-4a38-b167-8f8fa1359949",
            "description": "",
            "name": "finance_2019",
            "path": "/shared/finance_2019",
            "type": "dashboard",
            "kind": "c#info",
            "state": "valid",
            "version": 0,
            "system_properties": {
                "created_date": "2020-04-08T20:48:10.654Z",
                "created_user_id": "5d39c9bbe4b0e222859a1452",
                "created_user_pretty_name": "Admin",
                "modified_date": "2020-04-08T20:48:10.654Z",
                "modified_user_id": "5d39c9bbe4b0e222859a1452",
                "modified_user_pretty_name": "Admin",
                "used_date": "2020-05-12T14:55:01.980Z",
                "used_user_id": "5d39c9bbe4b0e222859a1452",
                "used_user_pretty_name": "Admin",
                "permissions": [
                    "list",
                    "open",
                    "write",
                    "manage",
                    "secure"
                ]
            },
            "dynamic_properties": {
                "delete_link": "idvisualizations/r/v2/content/shared/%EB%A6%AC%EB%84%A4%EC%83%A4%EB%AF%BC%EA%B8%B0%EC%88%98/",
                "thumbnail_link": "idvisualizations/r/v2/attachment/shared/%EB%A6%AC%EB%84%A4%EC%83%A4%EB%AF%BC%EA%B8%B0%EC%88%98/?name=thumbnail"
            },
            "custom_properties": {}
        }
    ]
}

Children assets of the folder are listed in an array under value.

Get and filter children assets of a folder

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets(path='%252fshared')?$expand=Assets($expand=content;$filter=name eq 'demo')

This GET request retrieves and filters the children assets of a folder.

Syntax

The following is the syntax for retrieving an asset from the asset ID:

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets(path='<folder path>')?$expand=Assets($expand=content;$filter=<filter type> <filter condition> '<filter value>')

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Folder path The path of the folder where your assets are located in.
Filter type The type of data that you want to filter the children by.
Filter condition Set to eq to filter the children based on the equals filter condition.
Filter value The value that you want to filter the children on.

Result

Example of a response from a successful request

{
    "@odata.context": "http://localhost:1338/v1/$metadata#Assets/$entity",
    "@odata.id": "http://localhost:1338/v1/Assets('c2c24d17-8abb-478e-a2e5-c2853cdae81a')",
    "@odata.editLink": "http://localhost:1338/v1/Assets('c2c24d17-8abb-478e-a2e5-c2853cdae81a')",
    "id": "c2c24d17-8abb-478e-a2e5-c2853cdae81a",
    "description": "",
    "name": "shared",
    "path": "/shared",
    "type": "folder",
    "kind": "c#info",
    "state": "valid",
    "version": 0,
    "system_properties": {
        "created_date": "2019-07-25T15:24:42.304Z",
        "created_user_id": null,
        "created_user_pretty_name": null,
        "modified_date": "2019-07-25T15:24:42.304Z",
        "modified_user_id": null,
        "modified_user_pretty_name": null,
        "used_date": "2019-07-25T15:24:42.304Z",
        "used_user_id": null,
        "used_user_pretty_name": null,
        "permissions": [
            "list",
            "open",
            "write",
            "manage",
            "secure"
        ]
    },
    "dynamic_properties": {
        "delete_link": "idvisualizations/r/v2/content/shared/",
        "thumbnail_link": "idvisualizations/r/v2/attachment/shared/?name=thumbnail"
    },
    "custom_properties": {
        "NATURE": "SYSTEM",
        "WA_PRO_READY": "true"
    },
    "Assets": [
        {
            "@odata.id": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
            "@odata.editLink": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
            "id": "0985d8bf-6fb2-42d8-a31d-5a312f43e18c",
            "description": "",
            "name": "demo",
            "path": "/shared/demo",
            "type": "dashboard",
            "kind": "c#info",
            "state": "valid",
            "version": 0,
            "system_properties": {
                "created_date": "2020-05-12T19:02:37.414Z",
                "created_user_id": "5d39c9bbe4b0e222859a1452",
                "created_user_pretty_name": "Admin",
                "modified_date": "2020-05-12T19:02:37.414Z",
                "modified_user_id": "5d39c9bbe4b0e222859a1452",
                "modified_user_pretty_name": "Admin",
                "used_date": "2020-05-12T19:34:33.742Z",
                "used_user_id": "5d39c9bbe4b0e222859a1452",
                "used_user_pretty_name": "Admin",
                "permissions": [
                    "list",
                    "open",
                    "write",
                    "manage",
                    "secure"
                ]
            },
            "dynamic_properties": {
                "delete_link": "idvisualizations/r/v2/content/shared/demo/",
                "thumbnail_link": "idvisualizations/r/v2/attachment/shared/demo/?name=thumbnail"
            },
            "custom_properties": {},
            "content": {
                "container": "C",
                "filter": [],
                "calculation": [],
                "querySubject": [],
                "version": "6.0",
                "dataSource": [],
                "useSpec": []
            }
        }
    ]
}

Get, filter, and select assets

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets(path='%252Fshared')?$expand=Assets($select=name;$filter=name eq 'demo')&$select=name

This GET requests retrieves and expands the shared folder assets. The request then filters the children assets and returns the specified $select value from children assets matching the specified $filter value. A $select option is also applied to the shared folder and returns the specified $select value for the folder.

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets(path='<folder path>')?$expand=Assets($select=<select type>;$filter=<filter type> <filter condition> '<filter value>')&$select=<select type>

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Folder path The path of the folder where your assets are located in.
Filter type The type of data that you want to filter the children by.
Filter condition Set to eq to filter the children based on the equals filter condition.
Filter value The value that you want to filter the children on.
Select type The type of data that you want to select by.

Result

Example of a response from a successful request

{
    "@odata.context": "http://localhost.fyre.ibm.com:1338/v1/$metadata#Assets(name)/$entity",
    "@odata.id": "http://localhost:1338/v1/Assets('c2c24d17-8abb-478e-a2e5-c2853cdae81a')",
    "@odata.editLink": "http://localhost:1338/v1/Assets('c2c24d17-8abb-478e-a2e5-c2853cdae81a')",
    "name": "shared",
    "Assets": [
        {
            "name": "demo"
        }
    ]
}

Get, filter, select, and expand assets

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets(path='%252Fshared')?$expand=Assets($select=id,type,path;$expand=content;$filter=name eq 'demo')

This GET requests retrieves and expands the shared folder assets. The request then filters the children assets and returns the specified $select value from children assets matching the specified $filter value. A $select option is also applied to the shared folder and returns the specified $select value for the folder.

Unlike the previous example, this request also expands the content of the returned children assets by using the $expand=content option.

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets(path='<folder path>')?$expand=Assets($select=<select type>;$filter=<filter type> <filter condition> '<filter value>')&$select=<select type>

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Folder path The path of the folder where your assets are located in.
Filter type The type of data that you want to filter the children by.
Filter condition Set to eq to filter the children based on the equals filter condition.
Filter value The value that you want to filter the children on.
Select type The type of data that you want to select by.

Result

Example of a response from a successful request

{
    "@odata.context": "http://localhost:1338/v1/$metadata#Assets/$entity",
    "@odata.id": "http://localhost:1338/v1/Assets('c2c24d17-8abb-478e-a2e5-c2853cdae81a')",
    "@odata.editLink": "localhost:1338/v1/Assets('c2c24d17-8abb-478e-a2e5-c2853cdae81a')",
    "id": "c2c24d17-8abb-478e-a2e5-c2853cdae81a",
    "description": "",
    "name": "shared",
    "path": "/shared",
    "type": "folder",
    "kind": "c#info",
    "state": "valid",
    "version": 0,
    "system_properties": {
        "created_date": "2019-07-25T15:24:42.304Z",
        "created_user_id": null,
        "created_user_pretty_name": null,
        "modified_date": "2019-07-25T15:24:42.304Z",
        "modified_user_id": null,
        "modified_user_pretty_name": null,
        "used_date": "2019-07-25T15:24:42.304Z",
        "used_user_id": null,
        "used_user_pretty_name": null,
        "permissions": [
            "list",
            "open",
            "write",
            "manage",
            "secure"
        ]
    },
    "dynamic_properties": {
        "delete_link": "idvisualizations/r/v2/content/shared/",
        "thumbnail_link": "idvisualizations/r/v2/attachment/shared/?name=thumbnail"
    },
    "custom_properties": {
        "NATURE": "SYSTEM",
        "WA_PRO_READY": "true"
    },
    "Assets": [
        {
            "@odata.id": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
            "@odata.editLink": "http://localhost:1338/v1/Assets('0985d8bf-6fb2-42d8-a31d-5a312f43e18c')",
            "id": "0985d8bf-6fb2-42d8-a31d-5a312f43e18c",
            "path": "/shared/demo",
            "type": "dashboard",
            "content": {
                "container": "C",
                "filter": [],
                "calculation": [],
                "querySubject": [],
                "version": "6.0",
                "dataSource": [],
                "useSpec": []
            }
        }
    ]
}

DEL requests

You can use DEL requests to delete an asset in Planning Analytics Workspace.

Delete an asset by ID

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets(id='0985d8bf-6fb2-42d8-a31d-5a312f43e18c',type='dashboard')

This DEL request locates and deletes an asset based on the asset ID and asset type.

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets('<asset ID>', type='<asset type>')

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Asset ID The ID for the asset.
Asset type The type of asset.

Result

The asset with the provided asset ID and type is deleted from Planning Analytics Workspace.

Delete an asset by path

Example of the syntax:

http://localhost:1338/pacontent/v1/Assets(path='%252Fshared%252Fdemo')

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets(path='<asset path>')

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Asset path The path of the asset.

Result

The asset located in the provided path is deleted from Planning Analytics Workspace.

PUT requests

You can use PUT requests to update an asset's custom_properties or content properties in Planning Analytics Workspace.

Update an asset using the asset ID and type

Example:

http://localhost:1338/pacontent/v1/Assets(id='196bf85d-329c-40ec-bb43-5098176197dd',type='dashboard')?$expand=content

Syntax

http://<Planning Analytics Workspace server URL>:<port number>/pacontent/v1/Assets(id='<asset ID>',type='asset type')?$expand=content

Values Description
Planning Analytics Workspace server URL The URL for the Planning Analytics Workspace server that your asset is located in.
Port number The port number used for your server URL.
Asset ID The ID for the asset.
Asset type The type of asset.

Body

Example of the request body

{
    "content": {
        "version": "7.0",
        "container": "C",
        "useSpec": [],
        "dataSource": [],
        "querySubject": [],
        "filter": [],
        "calculation": []
    },
    "custom_properties": {}
}

Result

Example of a response from a successful request

{
    "path": "/shared/demo",
    "dynamic_properties": {
        "delete_link": "idvisualizations/c/v2/content/dashboard/297df01f-debf-401f-8d4e-67a7b3c7b01e/",
        "extended_info_link": "idvisualizations/c/v2/info/dashboard/297df01f-debf-401f-8d4e-67a7b3c7b01e/?view=extended_info",
        "thumbnail_link": "idvisualizations/c/v2/attachment/dashboard/297df01f-debf-401f-8d4e-67a7b3c7b01e/?name=thumbnail",
        "open_link": "gemini/board/297df01f-debf-401f-8d4e-67a7b3c7b01e/?embed=ba1"
    },
    "system_properties": {
        "used_date": "2020-05-12T20:24:41.356Z",
        "used_user_id": "5d39c9bbe4b0e222859a1452",
        "used_user_pretty_name": "Admin",
        "attachments": [],
        "created_user_pretty_name": "Admin",
        "permissions": [
            "list",
            "open",
            "write",
            "manage",
            "secure"
        ],
        "created_user_id": "5d39c9bbe4b0e222859a1452",
        "modified_user_pretty_name": "Admin",
        "modified_user_id": "5d39c9bbe4b0e222859a1452",
        "created_date": "2020-05-12T20:24:22.555Z",
        "modified_date": "2020-05-12T20:24:41.367Z"
    },
    "kind": "c#info",
    "name": "demo",
    "description": "",
    "id": "297df01f-debf-401f-8d4e-67a7b3c7b01e",
    "state": "valid",
    "custom_properties": {},
    "type": "dashboard",
    "version": 0
}

The asset is updated with the specified values.