Understand how to build valid API requests.
API requests must be formed to an exact specification. In Anaplan Financial Consolidation they consist of an HTTP verb, also known as method; a root URL, the API version, an API endpoint, query parameters, headers, and a request body.
For example GET https://fluenceapi-prod.fluence.app//api/v2305.1/odata/ClientSchemaTable
where:
GET
is the HTTP verb/method.https://fluenceapi-prod.fluence.app
is the root URL./api/v2305.1
is the API version parameter./odata/ClientSchemaTable
is the endpoint, or resource path, followed by the name of the client schema table
API requests may also include header data and body data.
HTTP verb/method
HTTP methods are integral to a RESTful API request. APIs use common methods like GET, POST, PUT, and DELETE. These methods let you get, add, update, and delete data through API requests to the Financial Consolidation API.
Root URL
Your host name, known as the root URL, is a unique URL that represents an object, or group of data objects, accessible through HTTP. The Financial Consolidation API request has its own root URL, where the HTTP client is routed to interact with data resources.
API version
API requests in Anaplan Financial Consolidation must declare the current /api
API version as part of a valid request, immediately after the root URL. The current version of the API is 2305.1.
You must include /api/v2305.1
after the root URL, and before any endpoints and parameters.
Endpoint or resource path
A resource path refers to the part of the API's endpoint URL that identifies and locates a specific resource or collection of resources. It's usually a hierarchical representation of the resource's location within the API's data model.
A resource path comprises of one or more path segments, separated by forward slashes (/
). Each path segment may contain alphanumeric characters, as well as certain special characters such as hyphens (-
) or underscores (_
). The path segments navigate through the API's resource hierarchy and identify the target resource.
In the example below, the request's endpoint would be /odata
:
GET https://fluenceapi-prod.fluence.app/api/v2305.1/odata
Anaplan Financial Consolidation currently supports these endpoints:
Endpoint | Description | Example |
/odata | OData, known as the Open Data Protocol, is an OASIS standard defining best practices for building and consuming RESTful APIs. This standard enables you to retrieve, update, delete, and add data records. OData requests in the Financial Consolidation API use a resource path to name the data table. | GET https://fluenceapi-prod.fluence.app/api/v2305.1 /odata /ClientPathParam |
/process | Manage process workflows in Financial Consolidation, and enables you to start, stop, or get the state of a workflow. | GET https://fluenceapi-prod.fluence.app/api/v2305.1 /process/start /ImportandExports/Data/ModelExport |
/models | Retrieve a list of dimensions, within a specific model. | GET https://fluenceapi-prod.fluence.app/api/v2305.1 /models /Consolidations/Dimensions |
/metadata | Retrieve a list of all dimensions, including parent-child relationships and attributes, across a tenant, or the properties of a dimension you specify. | GET https://fluenceapi-prod.fluence.app/api/v2305.1 /metadata /Dimensions |
/users | Manage user roles and permissions, get a list of users, add, update, remove, and assign roles to individual users in your tenant. | GET https://fluenceapi-prod.fluence.app/api/v2305.1 /users |
Query parameters
Query Parameters serve as criteria for filtering, sorting, and allowing API requests to retrieve specific data. You can use logical operators within the query parameters.
API query parameters are optional key-value pairs that appear after the question mark in the URL. They serve as URL extensions and help determine specific content or actions based on the delivered data. To append query parameters, use a '?
' at the end of the request URL, followed by the parameter name and value.
For example, you can use a query parameter to filter the results when you retrieve data from a table.
Multiple query parameters can be added by separating them with an ampersand (&
), forming a query string. Query parameters can accommodate various object types with varying lengths, including strings and numbers.
Learn more about query parameters.
Chaining parameters
Some endpoint paths contain a chain of parameters that you build step-by-step to form a request. Use the ?Page parameter to specify the query page to retrieve. Use the ?PageSize to specify how many rows to fetch for the page. For example, to get the dimension metadata and its underlying properties, you might use something like this: https://fluenceapi-prod.fluence.app/api/v2305.1/metadata/Dimensions/DataView?Page=1&PageSize=100
Header
Request headers contain information that represent elements such as the authentication token and the account tenant. A REST header may also specify the data format of the request and response, and provides information about the request's status.
For example:
curl --location --request PUT 'https://fluenceapi-prod.fluence.app/api/v2305.1/odata/Consolidation?Account_Name=1110' \
--header 'TENANT: CustomerTenant' \
--header 'Content-Type: application/json' \
--header 'X_API_TOKEN: ••••••' \
In the example above, we have three headers:
Tenant
: The tenant where your data resides.Content-Type
: the data format sent in the request body. This case specifies that the body content is in JSON format.X_API_TOKEN
: the value of a valid API token created by an administrator, in the form of an API key.
These headers provide essential information to the server, enabling it to process the request correctly and securely.
The request body
An API request also consists of data (referred to as the “body”) that usually works with the POST and PUT HTTP methods. The body data refers to the payload or content sent along with the request. It contains the data that needs to be transmitted to the server for processing, such as JSON, or CSV data.
For example, to add a record to a client table, the body must contain all the items in the record:
curl --location POST 'https://fluenceapi-prod.fluence.app/api/v2305.1/odata/Consolidation?Account_Name=1110' \
--header 'TENANT: CustomerTenant' \
--header 'Content-Type: application/json' \
--header 'X-API-TOKEN: ••••••' \
--data '{
"Account_Name": "1110",
"Audit_Name": "Input",
"CostCenter_Name": "105",
"Currency_Name": "USD",
"DataView_Name": "Value",
"Date_Name": "2021 Dec",
"Entity_Name": "240",
"Intercompany_Name": "No Entity",
"Movement_Name": "Unmapped",
"Product_Name": "Product",
"Scenario_Name": "Budget",
"Amount": 120000.00,
"Text": "",
"Periodic_Amount": 0
}'
In the example above, the request is a POST method to create a new row of budget data within the Consolidation
client schema table. The body data is represented in JSON format and includes information about the record. In this case, the body data reflects which member for the intersection of Account, Audit, CostCenter, Currency, DataView, Date, Entity, Intercompany, Movement, Product, Scenario, Measure, Amount, text, and Periodic_Amount will be used to create a new row in the table.
It's important to note that not all API requests require a body. For example, GET requests typically don't have a body since they retrieve data from the server rather than sending data to it. However, methods like POST and PUT often require a body to send data for creation or updating purposes.
API responses
The API response is the server's reply to the client's request. It contains the data or information requested by the client. The response is typically sent back to the client in the body of an HTTP response. The response payload can be whatever is practical.
Responses include the following elements:
- Status: shows the status of the request. It can be “success” or “error”.
- Code: shows numerical status code that represents success or failure of the request.
- Data: contains the actual data returned by the API. Data responses are typically in JSON format.
Response codes
Financial Consolidation API requests return HTTP responses in the 2XX
, 4XX
, and 5XX
categories.
2XX
responses indicate a success with the API call.4XX
responses indicate an issue with the request. Check for mandatory request parameters. Then check if the request parameters and body contain the required values and types. There should be an error message in the response body to help diagnose the error.5XX
responses indicate communication issues between the client and API server.
The table below displays the expected HTTP responses for the Financial Consolidation API.
Status code | Meaning |
200 OK | The request was successful. |
204 No Content | The request was successful, but there’s no representation to return. This means that the response is empty. This is the expected response to a POST for tasks. |
400 Bad Request | The request is incorrect in some way, perhaps specifying incorrect values, or missing some out. The 400 Bad Request is accompanied by a clarifying message. |
401 Unauthorized | Your authentication token is incorrectly formed, or is invalid. |
403 Forbidden | You do not have permission to perform the requested action. |
404 Not Found | The requested resource cannot be found. |
405 Method Not Allowed | Wrong HTTP verb for this call (for example, using POST or PUT to an call that only allows GET ). |
406 Not Acceptable | The data request is in a format the server cannot provide. Check the Accept header. Generally, data exchanges between clients and the API server are presented in application/json . |
409 Conflict | An attempt to change a resource in a way that it cannot be changed. For example, if you attempt to add something that has already been added. |
410 Gone | The requested resource, such as a tenant, has been moved. This can be due to a sudden change to the state of the tenant while the request is in process. If you receive this response, try again. The request is rerouted and should succeed on a subsequent try. |
415 Unsupported Media Type | The request body is in an unsupported format. Adjust to a supported format in the Content-Type header of your call. |
429 Too Many Requests | You're making too many requests. Wait and try your request again. |
500 Internal Server Error | Error processing the request. This usually indicates that the request is not correctly formed. |
502 Bad Gateway | Network communication problems and DNS resolution issues can display this error. Try again later, or speak to your system administrator. |
503 Service unavailable | Service unable to accept the request. |
504 Gateway Timeout | Network issues that arise from the gateway being down or overwhelmed with requests. |