When is data loaded through REST?
The initial data load reads CSV files or a database once, when Atoti Limits starts and connects to the Atoti Server instance. REST covers data that changes while the server is up. For example:- An upstream system sends new or changed limit structures and limits.
- A program generates limits from cube data and sends the limits to the JSON endpoints. For example, a new counterparty appears in the cube and a default limit is created for it.
In what order is data loaded?
Limit structures are loaded before limits, because creating a limit requires information from its limit structure. The as-of date can be set at any point. For more information, see Date roll.How is a CSV file uploaded?
The upload is aPOST request with a multipart/form-data body that contains the CSV file in a part named file:
For example, to upload a limit structures file:
How are limit structures and limits sent as JSON?
The objects go in a JSON body, with theContent-Type header set to application/json. All endpoints start with /limits/rest/v2/limitDefinition.
The
create and update endpoints suit callers that know which operation is needed: a mistake then fails instead of silently doing the other operation. The save endpoints suit data that does not show whether the object exists.
For the request bodies, see REST APIs.
What permissions does the caller need?
The caller needs the same roles as a user of the UI:
The
save endpoints need the create role, the update role, or both, depending on whether each object is created or updated.
For what each role allows, see Set up and start.
The Atoti Limits server authenticates REST requests with its own security configuration, as it does for the UI. The caller authenticates as a user who holds the roles above.
What happens when the data is invalid?
Atoti Limits validates the whole request before creating anything: if any row or item fails validation, the request is rejected and nothing is created. For the validation checks, see Add custom validation. When validation fails, the response has the HTTP status400 and a problem detail body. Its action property suggests how to fix the request, and its validationErrors property lists each error. For the error format, see Add custom validation error handling.
The default validation also rejects duplicates:
- A new limit structure with the same name as an existing one.
- A new limit that overlaps a live limit with the same structure, limit type, and scope, if the date ranges share at least one day. For the rule, see Limit overlapping date validation.