跳至主要内容
Adaptive Planning
上次更新时间 :2023-03-10
Time

Time

URL Endpoint

HTTPS://api.adaptiveinsights.com/api/rest/modeling/{version}/{tenant}/updateTime
Version: v1
Category
Metadata Modification
Description
Update time structure in planning
Permissions Required to Invoke
Configure Calendar
Parameters Required on Request
N/A

Supported HTTP Verbs

HTTP verb
Description
POST
Based on the operation parameter, reload / update / append the time structure in planning. If the operation parameter is not specified, default to the append operation.

POST

Request
/updateTime: Updates the time structure
Updates the time structure in planning based on the operation (reload / update / append) specified as a query parameter (append by default if operation is not specified):
  • Reload: Reload the entire time structure. All existing data will be cleared. We also allow setting the default stratum through reloads.
  • Update: Update the existing time structure, e.g. change labels for existing time strata, add new strata, etc. We also allow setting the default stratum through updates.
  • Append: Add new time periods to the time structure. You cannot modify time periods, add a new level of granularity for time periods, or delete time periods when you append.
Sample Request URI:
HTTPS://api.adaptiveinsights.com/api/rest/modeling/v1/TIMEREALM/updateTime?operation
Sample Request Header
Authorization: Basic or Token based.
Content-Type: application/json
Request Body
Sample Request Body
{ "calendars": [ { "name": "DefaultHierarchy", "strata": [ { "code": "month", "label": "Month", "shortName": "Mon" }, { "code": "qtr", "label": "Quarter", "shortName": "Qtr" }, { "code": "year", "label": "Year", "shortName": "Yr" } ] }, { "name": "AltHierarchy", "strata": [ { "code": "month" }, { "code": "altQtr", "label": "AltQuarter", "shortName": "AltQtr" }, { "code": "altYear", "label": "AltYear", "shortName": "AltYr" } ] } ], "periods": [ { "startDate": "2022-01-01", "endDate": "2023-01-01", "code": "2022", "label": "FY2022", "shortName": "2022", "stratum": "year" }, { "startDate": "2022-01-01", "endDate": "2022-04-01", "code": "Q1-2022", "label": "Q1-FY2022", "shortName": "Q1", "stratum": "qtr" }, { "startDate": "2022-01-01", "endDate": "2022-02-01", "code": "01/2022", "label": "Jan-2022", "shortName": "Jan", "stratum": "month" }, { "startDate": "2022-02-01", "endDate": "2022-03-01", "code": "02/2022", "label": "Feb-2022", "shortName": "Feb", "stratum": "month" }, { "startDate": "2022-03-01", "endDate": "2022-04-01", "code": "03/2022", "label": "Mar-2022", "shortName": "Mar", "stratum": "month" }, { "startDate": "2022-04-01", "endDate": "2022-07-01", "code": "Q2-2022", "label": "Q2-FY2022", "shortName": "Q2", "stratum": "qtr" }, { "startDate": "2022-04-01", "endDate": "2022-05-01", "code": "04/2022", "label": "April-2022", "shortName": "April", "stratum": "month" }, { "startDate": "2022-05-01", "endDate": "2022-06-01", "code": "05/2022", "label": "May-2022", "shortName": "May", "stratum": "month" }, { "startDate": "2022-06-01", "endDate": "2022-07-01", "code": "06/2022", "label": "June-2022", "shortName": "June", "stratum": "month" }, { "startDate": "2022-07-01", "endDate": "2022-10-01", "code": "Q3-2022", "label": "Q3-FY2022", "shortName": "Q3", "stratum": "qtr" }, { "startDate": "2022-07-01", "endDate": "2022-08-01", "code": "07/2022", "label": "July-2022", "shortName": "July", "stratum": "month" }, { "startDate": "2022-08-01", "endDate": "2022-09-01", "code": "08/2022", "label": "Aug-2022", "shortName": "Aug", "stratum": "month" }, { "startDate": "2022-09-01", "endDate": "2022-10-01", "code": "09/2022", "label": "Sept-2022", "shortName": "Sept", "stratum": "month" }, { "startDate": "2022-10-01", "endDate": "2023-01-01", "code": "Q4-2022", "label": "Q4-FY2022", "shortName": "Q4", "stratum": "qtr" }, { "startDate": "2022-10-01", "endDate": "2022-11-01", "code": "10/2022", "label": "Oct-2022", "shortName": "Oct", "stratum": "month" }, { "startDate": "2022-11-01", "endDate": "2022-12-01", "code": "11/2022", "label": "Nov-2022", "shortName": "Nov", "stratum": "month" }, { "startDate": "2022-12-01", "endDate": "2023-01-01", "code": "12/2022", "label": "Dec-2022", "shortName": "Dec", "stratum": "month" }, { "startDate": "2023-01-01", "endDate": "2024-01-01", "code": "2023", "label": "FY2023", "shortName": "2023", "stratum": "year" }, { "startDate": "2023-01-01", "endDate": "2023-04-01", "code": "Q1-2023", "label": "Q1-FY2023", "shortName": "Q1", "stratum": "qtr" }, { "startDate": "2023-01-01", "endDate": "2023-02-01", "code": "01/2023", "label": "Jan-2023", "shortName": "Jan", "stratum": "month" }, { "startDate": "2023-02-01", "endDate": "2023-03-01", "code": "02/2023", "label": "Feb-2023", "shortName": "Feb", "stratum": "month" }, { "startDate": "2023-03-01", "endDate": "2023-04-01", "code": "03/2023", "label": "Mar-2023", "shortName": "Mar", "stratum": "month" }, { "startDate": "2023-04-01", "endDate": "2023-07-01", "code": "Q2-2023", "label": "Q2-FY2023", "shortName": "Q2", "stratum": "qtr" }, { "startDate": "2023-04-01", "endDate": "2023-05-01", "code": "04/2023", "label": "April-2023", "shortName": "April", "stratum": "month" }, { "startDate": "2023-05-01", "endDate": "2023-06-01", "code": "05/2023", "label": "May-2023", "shortName": "May", "stratum": "month" }, { "startDate": "2023-06-01", "endDate": "2023-07-01", "code": "06/2023", "label": "June-2023", "shortName": "June", "stratum": "month" }, { "startDate": "2023-07-01", "endDate": "2023-10-01", "code": "Q3-2023", "label": "Q3-FY2023", "shortName": "Q3", "stratum": "qtr" }, { "startDate": "2023-07-01", "endDate": "2023-08-01", "code": "07/2023", "label": "July-2023", "shortName": "July", "stratum": "month" }, { "startDate": "2023-08-01", "endDate": "2023-09-01", "code": "08/2023", "label": "Aug-2023", "shortName": "Aug", "stratum": "month" }, { "startDate": "2023-09-01", "endDate": "2023-10-01", "code": "09/2023", "label": "Sept-2023", "shortName": "Sept", "stratum": "month" }, { "startDate": "2023-10-01", "endDate": "2024-01-01", "code": "Q4-2023", "label": "Q4-FY2023", "shortName": "Q4", "stratum": "qtr" }, { "startDate": "2023-10-01", "endDate": "2023-11-01", "code": "10/2023", "label": "Oct-2023", "shortName": "Oct", "stratum": "month" }, { "startDate": "2023-11-01", "endDate": "2023-12-01", "code": "11/2023", "label": "Nov-2023", "shortName": "Nov", "stratum": "month" }, { "startDate": "2023-12-01", "endDate": "2024-01-01", "code": "12/2023", "label": "Dec-2023", "shortName": "Dec", "stratum": "month" }, { "startDate": "2022-01-01", "endDate": "2023-01-01", "code": "alt2022", "label": "Alt FY2022", "shortName": "Alt2022", "stratum": "altYear" }, { "startDate": "2022-01-01", "endDate": "2022-05-01", "code": "altQ1-2022", "label": "Alt Q1-FY2022", "shortName": "AltQ1", "stratum": "altQtr" }, { "startDate": "2022-05-01", "endDate": "2022-07-01", "code": "altQ2-2022", "label": "Alt Q2-FY2022", "shortName": "AltQ2", "stratum": "altQtr" }, { "startDate": "2022-07-01", "endDate": "2022-09-01", "code": "altQ3-2022", "label": "Alt Q3-FY2022", "shortName": "AltQ3", "stratum": "altQtr" }, { "startDate": "2022-09-01", "endDate": "2023-01-01", "code": "altQ4-2022", "label": "Alt Q4-FY2022", "shortName": "AltQ4", "stratum": "altQtr" }, { "startDate": "2023-01-01", "endDate": "2024-01-01", "code": "alt2023", "label": "Alt FY2023", "shortName": "Alt2023", "stratum": "altYear" }, { "startDate": "2023-01-01", "endDate": "2023-05-01", "code": "altQ1-2023", "label": "Alt Q1-FY2023", "shortName": "AltQ1", "stratum": "altQtr" }, { "startDate": "2023-05-01", "endDate": "2023-07-01", "code": "altQ2-2023", "label": "Alt Q2-FY2023", "shortName": "AltQ2", "stratum": "altQtr" }, { "startDate": "2023-07-01", "endDate": "2023-09-01", "code": "altQ3-2023", "label": "Alt Q3-FY2023", "shortName": "AltQ3", "stratum": "altQtr" }, { "startDate": "2023-09-01", "endDate": "2024-01-01", "code": "altQ4-2023", "label": "Alt Q4-FY2023", "shortName": "AltQ4", "stratum": "altQtr" } ] }
Query Parameters
Name
Description
Required
operation
The time structure import operation we want to perform. It has to be either reload, update or append. If no operation is specified, we will perform append by default.
N
proceedWithWarnings
An optional query parameter used to dismiss warning messages. If not set to true, potential warnings will be returned before the call executes. Dismiss them by specifying this parameter to true in the URL.
N
skipAwaitCacheRefresh
An optional query parameter. If set true, the response will be returned as soon as it's ready, without waiting for the cache to refresh.
N
Payload Parameters
Time Structure Object
Name
Description
Required
calendars
List of all the calendar objects to be imported. The default calendar must come first. For update and append, users must include all the existing calendars.
N
periods
List of all the time period objects in the calendars. The time periods must be listed in depth-first search order for each calendar. The default calendar's time periods must come first. For alternate calendars, it is optional to re-list the time periods at the fork stratum or below.
N
Calendar Object
Name
Description
Required
name
Name of the calendar.
Y
strata
List of stratum objects in the calendar, should be in level ascending order with the lowest level being the most granular stratum. For alternate calendars, it is optional to re-list the strata below the fork stratum.
Y
code
Code of the calendar. Supported when calendar codes are present.
N
Stratum Object
Name
Description
Required
code
Code of the time stratum, should be unique.
Y
label
Label of the time stratum, should be unique. Not required for shared strata that are re-listed under an alternate calendar.
Y
shortName
Short name of the time stratum, should be unique. Not required for shared strata that are re-listed under an alternate calendars.
N
isDefaultStratum
Whether the time stratum is the default stratum. We only allow setting the default stratum in reload or update operations. If isDefaultStratum is not specified for any strata, we will assume that the leaf stratum is the default stratum for the reload operation, and the existing default stratum remains unchanged for the updated operation.
N
Period Object
Name
Description
Required
startDate
Start date of the time period, should be in the yyyy-MM-dd format.
Y
endDate
End date of the time period, should be in the yyyy-MM-dd format.
Y
code
Code of the time period, should be unique.
Y
label
Label of the time period.
Y
shortName
Short name of the time period.
N
stratum
The code of the stratum this time period belongs to.
Y
instanceCode
The instanceCode to retrieve values from. For example, GLOBO. If no instanceCode is specified, the default instance of the user is used.
N

Response

204 No Content
Successful reponse is blank with status code 204.
400 Bad Request
The request could not be understood by the server.
Example:
{ "message": "Include only one of these valid operation parameters in the request: reload, update, or append.", "status": 400 } { "error": "Errors occurred while processing the request.", "errors": [ { "error": "Stratum code is required. Specify a code.", "field": "calendars[0].strata[2].code", "code": "PLN310002" } ] } { "error": "Errors occurred while processing the request", "errors": [ { "error": "Last descendant period (12/2022) end date (2023-01-02) doesn't match the ancestor period (Q4-2022) end date (2023-01-01).", "field": "periods[16]", "code": "PLN310002" }, { "error": "Last descendant period (12/2022) end date (2023-01-02) doesn't match the ancestor period (2022) end date (2023-01-01).", "field": "periods[16]", "code": "PLN310002" } ] }
401 Unauthorized
User is not authorized.
Example:
{ "message": "Invalid credential", "status": 401 }
401 Forbidden
User has insufficient permissions.
Example:
{ "message": "This resource is only available when the JSON based time API feature and the alternate time roll-up feature are enabled.", "status": 403 }
500 Internal Server Error
Internal Server Error.