Skip to Content
BackendAPIAPI - DataProcessor - Process action

API - DataProcessor - Process action

This documentation is only valid for the API version of a DataProcessor process.

Request Metadata

The process request can get complicated, depending on the data collectors related to the data processor. To make it easier to make a correct process request, a “process metadata” endpoint has been added, which the result can be cached for later usage, it will only change if data collectors parameters or processor results are changed.

Endpoint

This is the process metadata endpoint:

/dataanalysis_dataprocessors/{id}/metadata

or

/dashboard_widgets/{id}/metadata

Not to be confused with /dataanalysis_dataprocessors/metadata/{id}, which is for the entity metadata. We will probably refactor the process metadata endpoint, I did not know there was already a similar endpoint at the time.

It’s a simple GET operation, which returns all you need to know about the process.

Example of response:

{ "parameters": { "products-listing-with-tags_5": { "locale": { "name": "locale", "prefix": "products-listing-with-tags_5", "type": "text", "defaultValue": "" } }, "limit": { "name": "limit", "prefix": "", "type": "number", "defaultValue": 25 }, "offset": { "name": "offset", "prefix": "", "type": "number", "defaultValue": 0 } }, "results": [ "ID", "Nom", "SKU", "Fournisseur", "supplierName", "supplierCode", "Balises", "Inventaire", "Prix", "Cost" ], "managerName": "list" }

So from that example, I now know that to process the data, I should send a process request with like this:

GET: ?products-listing-with-tags_5[locale]=fr_CA&limit=25&offset=0

POST:

{ "params": { "products-listing-with-tags_5": { "locale": "fr_CA" }, "limit": 25, "offset": 0 } }

I also know that I will receive these following fields in the result:

"ID", "Nom", "SKU", "Fournisseur", "supplierName", "supplierCode", "Balises", "Inventaire", "Prix", "Cost"

This way we know what to expect.

Manager type

The metadata also returns the manager type, so you know how the resulting data is formatted for.

For example, the list manager returns a result formatted perfectly for a list.

The default manager will have its output formatted differently.

Process endpoint

The process request will take given parameters and fetch data from all collectors and output results using the data processor results, in any supported format.

Endpoint

This is the process endpoint:

/dataanalysis_dataprocessors/{id}/process

or

/dashboard_widgets/{id}/populate

They are both available in GET or POST, which returns the same resulting data.

Example of response:

{ "@context": { "@vocab": "http://localhost:8000/open-api/v3/docs.jsonld#", "hydra": "http://www.w3.org/ns/hydra/core#", "result": "ProcessOutput/result" }, "@type": "ProcessOutput", "@id": "/open-api/v3/.well-known/genid/80ff29dc069da40c0cdb", "result": { "data": [ { "ID": 4, "Nom": "Produit de base", "SKU": "", "Fournisseur": 1, "supplierName": " Interne in", "supplierCode": "", "Balises": "Balise", "Inventaire": "0.00000", "Prix": "0.00000", "Cost": "0.00000" }, { "ID": 5, "Nom": "Composante de base", "SKU": "", "Fournisseur": 1, "supplierName": " Interne in", "supplierCode": "", "Balises": "", "Inventaire": "0.00000", "Prix": "0.00000", "Cost": "0.00000" } ], "total": 2 } }

This example is from a list processor manager, so we can see that it is formatted perfecty for a list.

Last updated on