# Data Manager ## List Data Manager Entities - [POST /datamart.getfcs/{TypeCode}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.getfcs-typecode.md): Retrieves Data Manager Entities (Field Collections), including object's metadata. A filter can be applied. Action| Endpoint| ---------|----------| List Data Feeds | /datamart.getfcs/DMF List Data Sources | /datamart.getfcs/DMDS List Datamarts | /datamart.getfcs/DM List Datamart Model Tables | /datamart.getfcs/DMT List Data Loads | Use a different endpoint to retrieve Data Loads: /datamart.getdataloads ## Execute a Data Load Logic - [POST /datamart.distcalcparams/{typedId}/{logicName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.distcalcparams-typedid-formulaname.md): Executes the logic in the DMDataLoad context and returns the parameter definitions or test results. ## Get a DM Object - [POST /datamart.fetch/{objectId}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.fetch-objectid.md): Retrieves the object's (Data Feed, Data Source, Datamart) row level data. A filter can be applied. If you want to achieve better performance when fetching large data sets and if you do not need the total number of items in the table – use the /datamart.fetchnocount/{typedId} endpoint instead. You can choose fields to be returned in the response by employing the resultFields or valueFields filter: resultFields: returns key-value pairs as objects. This is the more friendly response compared to valueFields but the server fetches all fields from the database in the backend which might result in a slower performance. See the List Product's listProductsResponseExample_resultFields response example. valueFields: returns just an array of values. Use this option if a better performance is required. See the List Product's listProductsResponseExample_valueFields response example. >When distinctResults is set to true, it applies only to the first column specified in the valueFields array. For example, if "valueFields": ["ConditionType", "TableNumber"] is used, only distinct values for ConditionType are returned. >Please note: >When paging is applied, use a deterministic sort (for example, "sortBy":["InvoiceLineID"]). If no sorting is defined when paging, you may get duplicates in the response. ## Get a DM Object (no count) - [POST /datamart.fetchnocount/{objectId}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.fetchnocount-objectid.md): Retrieves the object's (Data Feed, Data Source, Datamart) row level data and skips the count() query - it does not return a total number of rows in the entire table when the filter is applied, it returns just the total number of rows in the response. >Information: >Use this endpoint when you need a better performance when fetching large data sets and when you do not need to fetch a total number of items in the table. Usually used for integration purposes. ## Update a Data Manager Entity - [POST /datamart.updatefc/{TypeCode}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.updatefc-typecode.md): Updates and deploys a field collection (FC) definition - Data Feed (DMF), Datamart (DM), or Data Source (DMDS). >Information: >If Data Source (DMDS) is added or updated, then a Data Feed (DMF) is created for the corresponding Data Source. ## Create a Data Manager Entity - [POST /datamart.newfc/{TypeCode}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.newfc-typecode.md): Creates a field collection (FC) definition - Data Feed (DMF), Datamart (DM), or Data Source (DMDS). ## Upload a Bulk Data to Data Source - [POST /datamart.loaddata/{datasourceUniqueName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.loaddata-datasourceuniquename.md): Uploads a chunk (batch) of data from a client resource to the storage reserved for a particular Data Source. The uploaded data is not immediately transfered to the Data Source database table. Instead it is held (‘buffered’) in a staging area, until an explicit flush command is issued (refer to the /datamart.rundataload endpoint, "type": "DS_FLUSH"), or a Datamart dependent on the Data Source data is refreshed. ## Run a Data Load - [POST /datamart.rundataload](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.rundataload.md): Schedules a Data Load for immediate (but asynchronous) execution. ## Save a Data Load - [POST /datamart.updatedataload](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.updatedataload.md): Updates an existing Data Load. ## Mass Edit - [POST /datamart.massedit/{typedId}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.massedit.md): Performs a Mass Edit operation on specified Datamart object - changes values of the specified field (column). ## List Data Loads (with validation and schedules) - [POST /datamart.getdataloads](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.getdataloads.md): Returns a list of Data Load definitions. If fetching Data Loads takes too long and you don't need validation and schedules, use the List Data Loads (/datamart.listdataloads) endpoint instead. ## List Data Loads - [POST /datamart.listdataloads](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.listdataloads.md): Returns a list of Data Load definitions. No validation is run on returned Data Loads and no schedules are loaded. Use this endpoint for listing only.If you need Data Loads to be validated and schedules returned, use the List Data Loads (with validation and schedules) (/datamart.getdataloads) endpoint instead. ## Delete a Data Manager Entity - [POST /datamart.deletefc/{TypeCode}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.deletefc.md): Deletes a field collection (FC) definition, i.e. Data Feed (DMF), Datamart (DM), or Data Source (DMDS). ## Query a Data Manager Object - [POST /datamart.query](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.query.md): Returns a list of objects that match the criteria specified in the request. ## SQL Query a Data Manager Object - [POST /datamart.sqlquery](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.sqlquery.md): Processes and queries data from Price Analyzer or Price Optimizer. The queries can be aggregated, do various computations including statistical projections. Supports filtering. ## List Rollups - [POST /datamart.getrollups](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.getrollups.md): Retrieves a list of Datamart Rollups based on filter settings. ## List Charts - [POST /datamart.getcharts](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.getcharts.md): Retrieves a list of saved charts, including chart's details. ## Import a Data Load - [POST /datamart.importdataloads](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.importdataloads.md): Imports a list of Data Load definitions. Existing definitions will be updated. >Information: >Omitting a property is equivalent to setting it to null. With one exception: a previously existing incLoadDate will be retained. ## Export an Excel File (XLSX) - [POST /datamart.exportdata/xlsx](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.exportdata-xlsx.md): Downloads an XLSX file. The returned file contains all definitions (meta) and the data. This is useful for importing the Data Source, Datamart, or Data Feed definitions + data in some other instance or partition. ## Export a CSV File - [POST /datamart.exportdata](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.exportdata.md): Downloads a ZIP file. The returned ZIP file contains Data Source, Datamart, or Data Feed definitions in the JSON file and data in the CSV file. ## Get a DM Export File - [POST /datamart.fetchexportfile/{fileName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.fetchexportfile-filename.md): Retrieves the file created using /datamart.export endpoint. Get the file name via datamart.getactionstatus/{actionUUID} endpoint. ## Get Action Status - [POST /datamart.getactionstatus/{actionUUID}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.getactionstatus-actionuuid.md): Retrieves the link of the exported file in the result property. Use the /datamart.fetchexportfile/{fileName} to download the file. ## Export Datamart - [POST /datamart.export/{fcTypedIdOrSourceName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.export.md): Exports the specified Datamart source. Typically used in an integration scenario (IM) for a given customer. The request’s body can contain a data block with a regular filter criteria definition (as, for example, used in the JSON API fetch commands), to filter the output rows. If the Analytics database for the parition is hosted in AWS, the export file(s) will be transferred to the corresponding S3 bucket, ready for retrieval using the datamart.fetchexportfile (Get a DM Export File) endpoint. Otherwise the files are put in the local file system of the node that handles the request: default path: server/temp//export// If needed, a different, absolute path can be set using an instance parameter: datamart.database.export.path Data is exported in the CSV format, and is always gzip-compressed. Character encoding is always UTF-8. There is no client side encryption. ## Restore Default Data Sources - [POST /datamart.restoredefaultds/{dataSourceName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-formulamanager.restoredefaultds.md): Creates a default Data Source (Product, Customer, Unit of Measures, Currencies, or Calendar). Use this endpoint if default Data Sources have not been created when setting up the partition. >Note: When no path parameter is passed, all default Data Sources are dropped and recreated - any data will be lost. >Othwerise, only the Data Source indicated by the path param is dropped and recreated. ## Import a File - [POST /datamart.importfile/{slotId}/{typedId}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.importfile.md): Uploads a file to the Data Manager (specified by typeId in the path parameter). > To import data into FieldCollection (DMT or DMDS), use the datamart.loadfc/{typedId} endpoint. Follow these steps to upload a file: 1. Create an upload slot and retrieve the slotId using the /uploadmanager.newuploadslot endpoint (see Product Image > 1. Create an Upload Slot). 2. Upload the file using the /datamart.importfile/{slotId}/{typedId} endpoint. When importing a CSV file, it is possible to include more information than just a column name. Example: columName1:NUMBER:KEY,columnName2:TEXT:DIM,columnName3:NUMBER a,1,0.5 b,1,0.6 c,2,1.2 d,3,2.0 In the example above you can see that columnName1 column should be the NUMBER field type and also the key (KEY). The columnName2 column should be the TEXT type and a dimension (DIM). The columnName3 column should be a NUMBER. Possible field types: BOOLEAN, CURRENCY, DATE, DATETIME, INTEGER, LOB, MONEY, NUMBER, QUANTITY, TEXT, UOM >Information: When using datamart.importfile to upload a file with huge numbers (20+ significant decimal digits) it is recommended to use the Avro format. In CSV and XLSX files, you can use numbers within the double type or long type ranges. ## Create a DMFieldCollection - [POST /datamart.createfc/{fcType}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.createfc-fctype.md): Creates a DMFieldCollection from a multipart/form-data body containing the schema (JSON – the DMFieldCollection DTO) as a first part and the data (AVRO format) as second part. Fails if the specified DMFieldCollection already exists. The first part contains information about the schema of the Field Collenction to be created: - for DMDataSource - uniqueName - label* - fields - for DMT - name - label - fields* - owner – the ModeObject typedId that owns the table. \* fields is a list of the DMFields specification. The second part contains the table data in the AVRO format. The data schema must comply with the one given in the first part. An existing table will be overriden (deletes an existing one, creates a new one). >This is an endpoint dedicated for remote services (such as Optimization Engine or Python Engine). It is very strict by design in order to ensure that the uploaded data ends up exactly in the same format in the platform. ## List Datamart Orphan Objects - [POST /datamart.deleteobsoletes](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.deleteobsoletes.md): Returns a list of orphan Datamart objects. Identifies and returns details about objects considered obsolete. Objects such as: - Datamart Tables with missing owners. - Data Loads for which the target Field Cache was deleted. - Analytics (PriceAnalyzer) tables without a matching deployed Field Cache (FC). By default this endpoint works in the dry run mode to mitigate accidental deletions. Actual deletions require adding explicit /delete in the endpoint URL. ## Delete Datamart Orphan Objects - [POST /datamart.deleteobsoletes/delete](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/data-manager/post-datamart.deleteobsoletes-delete.md): Deletes orphan Datamart objects. Identifies and deletes objects considered obsolete. Objects such as: - Datamart Tables with missing owners. - Data Loads for which the target Field Cache was deleted. - Analytics (PriceAnalyzer) tables without a matching deployed Field Cache (FC).