List or Select Template Accounts

Returns the template's line-item accounts.

Without q, accounts are sorted by account ID and returned as a paged collection; omitted paging parameters use offset 0 and limit 100. Supply q as a JSON object with a required, non-empty accounts array of non-blank account IDs to request specific account IDs in the array's order. A selected-account request is only paged when it also supplies offset or limit; otherwise it returns the selected list without offset, limit, or hasMore. Each returned account always has id, name, and a canonical link. Add fields to project optional account attributes. Paging links preserve all supplied query parameters, including q and fields. Malformed query JSON or an invalid query value type returns HTTP 400. A missing or empty accounts array, or a blank selected account ID, returns HTTP 422. An unknown selected account ID returns HTTP 404.

Required Roles

Service Administrator

REST Resource

GET /HyperionPlanning/rest/sm/v1/applications/{application}/templates/{template}/accounts

Request

Parameters:

Table 3-764 Parameters

Name Description Type Required Default
application Strategic Modeling application name. Path Yes None
template Name of an existing template in the application. URL-encode spaces and other reserved characters (for example, 'Health%20Care'). Path Yes None
q Optional JSON selection object used to retrieve specific accounts instead of browsing the full collection. When q is supplied, its accounts member is required and must be a non-empty array of non-blank account IDs. Malformed query JSON or an invalid query value type returns HTTP 400. A missing or empty accounts array, or a blank selected account ID, returns HTTP 422. An unknown selected account ID returns HTTP 404. URL-encode the parameter value when constructing a request, for example q=%7B%22accounts%22%3A%5B%22v1000%22%5D%7D Query No None
fields Comma-separated list of account field names to include in the response. Supported values are: accountType, dataType, valueStorageType, aggregationType, scale, and userDefinedAccount. id and name are always included. Names are case-insensitive; whitespace around each name is ignored. Unrecognized field names are ignored. Query No None
offset The zero-based index from which records are returned. Default: 0; Minimum: 0 Query No 0
limit The number of items to return. Must be a positive integer. Values above 200 are accepted; the effective page size is capped at 200. Default: 100; Minimum: 1 Query No 200

Example URL:

https://<BASE-URL>/HyperionPlanning/rest/sm/v1/applications/Sample/templates/Health%20Care/accounts

Response

Supported Media Types: application/json

Table 3-765 Parameters

Name Description
items Collection of information about the returned resources.
items[].id Identifier of the returned resource.
items[].name Name of the returned resource.
items[].links Links related to the resource or result.
items[].links[].href Link to the API call.
items[].links[].action HTTP call type.
items[].links[].rel Relationship type for the link.
count Count reported for the returned collection; confirm whether this is a page count or total count.
offset The zero-based index from which the records are returned.
limit The page size for the returned records.
hasMore True or false, indicating whether more pages of records are available.
links Links related to the resource or result.
links[].href Link to the API call.
links[].action HTTP call type.
links[].rel Relationship type for the link.

Sample Response

{
  "items": [
    {
      "id": "v0105",
      "name": "Period End Exchange Rate",
      "links": [
        {
          "href": "https://<BASE-URL>/HyperionPlanning/rest/sm/v1/applications/Sample/templates/Health%20Care/accounts/v0105",
          "action": "GET",
          "rel": "canonical"
        }
      ]
    }
  ],
  "count": 1,
  "offset": 0,
  "limit": 100,
  "hasMore": false,
  "links": [
    {
      "href": "https://<BASE-URL>/HyperionPlanning/rest/sm/v1/applications/Sample/templates/Health%20Care/accounts",
      "action": "GET",
      "rel": "canonical"
    }
  ]
}

Table 3-766 Status Codes

Code Description
400 Invalid query parameter, malformed q JSON, invalid query value type, or invalid paging value. Missing or empty selected-account arrays and blank selected account IDs are reported as HTTP 422 instead.
401 Authentication is required.
404 Application or requested sub-resource was not found.
422 When q is supplied, the accounts array is missing or empty, or a selected account ID is blank.
500 Unexpected server error.

Sample cURL Command

curl -X GET -u '<USERNAME>:<PASSWORD>' 'https://<BASE-URL>/HyperionPlanning/rest/sm/v1/applications/Sample/templates/Health%20Care/accounts'