Zum Hauptinhalt wechseln
Adaptive Planning
importTransactions

importTransactions

Category
Data submission
Description
Inserts new transactions.
Permissions Required To Invoke
Import
Parameters Required On Request
Credentials, ImportTransactionsOptions, RowData
This method only applies if you have access to Transactions.
You can only delete transactions during import. If you want to remove all transactions during import, consider importing one blank row and deleting the remaining data.
This method can be used to delete existing transaction rows which match certain criteria, to insert new transaction rows into the system, or to do both actions in one invocation (i.e. replace a set of transaction rows with another set of rows).

Request Format

<?xml version='1.0' encoding='UTF-8'?> <call method="importTransactions" callerName="a string that identifies your client application"> <credentials login="sampleuser@company.com" password="my_pwd" instanceCode="INSTANCE1"/> <importTransactionsOptions allowParallel="false" useMappings="false"/> <rowData> <header>Posting Date|Transaction Type|Account|Plan|Transaction Amount</header> <rows> <row>01/02/2011|Invoice|70110|Marketing|100</row> </rows> </rowData> </call>
Each invocation of this API call must contain exactly one element of each of the listed types:
  • credentials
  • importTransactionsOptions
  • rowData
A mismatch between the number of pipe characters ( | ) in the header and the data will cause an error for API v30 or higher.
credentials element
Tag Name
credentials
Description
All API calls must contain a singlecredentials element to identify the user invoking the API. The API call is then performed as this user (any audit trail or history of actions in the system will show that this user performed the action), and therefore the user must have the required permissions to perform the action in order for the API call to succeed.
Attributes of the Element
Attribute Name
Required?
Value
Example
login
Y
The login name of the user invoking the API method. This user must have the required permissions to invoke the method.
sampleuser@company.com
password
Y
The password of the user invoking the API method.
my_password
locale
N
Specify the locale to be used to interpret incoming numbers and dates, and to format outgoing numbers and dates (using the proper thousands separator, month names, and date formatting). The locale is also used to specify the language in which any system messages in the response should appear. If not specified, en_US (American English) is used.
fr_FR
instanceCode
N
If the user specified in the credentials has access to more than one instance of
Adaptive Planning
, this attribute can be used to specify that the user is intending to access an instance other than their default instance. If not specified, the user's default instance will be used. To determine the available instance codes, use the exportInstances API.
MYINSTANCE1
Contents of the Element
(none)
importTransactionsOptions
element
Tag Name
importTransactionsOptions
Description
Specifies the options to be used when performing the import. If at least one ofdeleteStartDate,deleteEndDate, ortransactionTypes are specified, then this method call will attempt to delete any existing transactions which match those specified criteria.
Attributes of the Element
Attribute Name
Required?
Value
Example
deleteStartDate
N
If this method call is intended to delete some existing transactions, this attribute specifies the start date of the set of transactions to be deleted (inclusive). If not specified, all transactions which have a date on or before thedeleteEndDate (and which matches one of the optional specifiedTransactionTypes) will be deleted.
11/01/2012
deleteEndDate
N
If this method call is intended to delete some existing transactions, this attribute specifies the end date of the set of transactions to be deleted (inclusive). If not specified, all transactions which have a date on or after thedeleteStartDate (and which match one of the optional specifiedTransactionTypes) will be deleted.
12/31/2012
transactionTypes
N
A set of transaction types which will be deleted, separated by the pipe symbol. If not specified, all transactions given betweendeleteStartDate anddeleteEndDate will be deleted. If nodeleteStartDate ordeleteEndDate is specified, all transactions of the specified types will be deleted regardless of their dates.
Invoice|Purchase Order
allowParallel
Y
If set totrue, then an import will proceed even if there is already another actuals or transactions import in process for this instance. If set tofalse, then an attempt to import will fail if there is already an actuals or transactions import being processed for this instance.
false
useMappings
N
Specifies whether to use import mappings for accounts, plans and dimension values inside the row elements. Consideredtrue by default. Iffalse then the internal identifiers should be used: accounts are identified by code, levels and dimension values by name.
false
includeContext
N
Specifies whether messages may include the context block. Values arefalse (never show context) ortrue (show context if appropriate). If not specified,true is assumed.
false
displayNameEnabled
Only available in API v31+ for instances that enable display name.
N
displayNameEnabled=true indicates API should expect Account Code, Level Code, Dimension Code and Dimension Name column in the payload when the Enable Display Name setting is ON for the instance.
displayNameEnabled=false indicates API should continue following pre- v30 API contract even when the Enable Display Name setting is ON for the instance.
The default value for displayNameEnabled is "false".
false
Contents of the Element
(none)
rowData element
Tag Name
rowData
Description
Container for the rows of data being imported.
Attributes of the Element
(none)
Contents of the Element
Exactly oneheader element and exactly onerows element.
header element
Tag Name
header
Description
Specifies the names and order of the columns of the data in the correspondingrows element.
Attributes of the Element
(none)
Contents of the Element
A line of text with vertical-bar-separated column names. These column names must correspond to the names of the dimensions or fields on the sheet, or to months that can contain data. They are identical to the column names found in the Import Template for the sheet to which the data is being imported, with each column header separated from the next by a vertical bar or pipe symbol.
For instances that enable Display Name, the header doesn't support
"<dimension>"
in combination with
"<dimension> Name"
or
"<dimension> Code"
in API v30 or higher for Adaptive Planning supported locales.
rows element
Tag Name
rows
Description
Container for one or morerow elements.
Attributes of the Element
(none)
Contents of the Element
One or morerow elements.
row element
Tag Name
row
Description
Data for a single row being imported.
Attributes of the Element
(none)
Contents of the Element
Data for the fields in a single row being imported, each field's value separated by a vertical bar or pipe symbol. The data fields must be in the same order as the line in the header element. If numbers in the values use thousands separators, they are assumed to be the comma separators used in the locale specified in the credentials of the request.

Response Format

These are examples of responses for successful and unsuccessful importing of transaction data.

Success Example

<?xml version='1.0' encoding='UTF-8'?> <response success="true"> <messages> <message key="row-imported">1 row was imported.</message> </messages> </response>

Failed (with context)

<?xml version='1.0' encoding='UTF-8'?> <response success="false"> <messages> <message key="error-import">Import Failed with the following error: No transactions were imported or deleted during the import.</message> <message key="import-detail">Additional information:</message> <message key="warning-nonexistent-dimension-value">Warning: No data was imported for rows with the following dimension values because the dimension values for Transaction Type do not exist: Invoice12.</message> <message key="invalid-dimension-choice-withCoordinate"> <context> <col header="Posting Date" value="01/02/2011" /> <col header="Transaction Type" value="Invoice12" /> <col header="Account" value="70110" /> <col header="Plan" value="Marketing" /> <col header="Transaction Amount" value="100.0" /> </context> Invalid Dimension Choice: Invoice12 on row 1 column B </message> </messages> </response>

Failed (no context)

<?xml version='1.0' encoding='UTF-8'?> <response success="false"> <messages> <message key="error-import">Import Failed with the following error: No transactions were imported or deleted during the import.</message> <message key="import-detail">Additional information:</message> <message key="warning-nonexistent-dimension-value">Warning: No data was imported for rows with the following dimension values because the dimension values for Transaction Type do not exist: Invoice12.</message> <message key="invalid-dimension-choice-withCoordinate">Invalid Dimension Choice: Invoice12 on row 1 column B</message> </messages> </response>
response element
Tag Name
response
Attributes of the Element
Attribute Name
Required?
Value
Example
success
Y
Eithertrue orfalse, indicating whether the API call was successful or not. Even successful calls may contain warning messages in their response.
true
Contents of the Element
A single optionalmessages element.
messages element
Tag Name
messages
Description
Container for one or moremessage elements.
Attributes of the Element
(none)
Contents of the Element
One or moremessage elements.
message element
Tag Name
message
Description
Represents a message being sent from the system back to the caller. Messages are used for error messages when requests do not succeed, for warning messages when requests do succeed, and for confirmation messages upon success.
Attributes of the Element
Attribute Name
Required?
Value
Example
key
N
When given, a key is a way to identify a particular message or type of message, useful for purposes of automated error logging and recovery in client programs. Keys do not change under different locales of requests, even when the language of the message changes. Keys also are unlikely to change in the future due to wording adjustments or terminology changes.
invalid-attributevalueid
Contents of the Element
  1. The text of the message. This text is in the language of the locale specified on the request (assuming that locale is supported). The text may also contain variable information such as the number of rows which were processed, or the particular column or value that caused an error.
  2. An optional context element.
context element
Tag Name
context
Description
Container for one or more col elements.
Attributes of the Element
Attribute Name
Required?
Value
Example
none
Contents of the Element
One or more col elements.
col element
Tag Name
col
Description
Represents the context for the message. Gives a header/value pair so the row generating the message can be identified.
Attributes of the Element
Attribute Name
Required?
Value
Example
header
Y
The header of the column.
"Account"
value
Y
The value in the column.
"GL-29482-38233"
Contents of the Element
(none)