Generate CSV from query


This request generates a CSV file with the results of a query.
This returns an Attachment object which can be downloaded with the default attachment API calls (check resources).

Resource

POST /queries/<OID>/generate_csv

Where OID is the object ID of the query.

Parameters

Name Type Description

where

[String]

A comma seperated list with the non-standard query filters.

This is a combination of group name + filter name ("<GROUPNAME>.<FILTERNAME>").
The filtername can also have multiple dots ("."), this is handled as one filtername.
The groupname and filtername that can be selected can be found in the GET Query response.

Some examples:
where=dategroup.startdate=2023-08-23 where=phonelinegroup.linename=support where=phonelinegroup.line1.commonName=support where=phonelinegroup.line1.commonName=support,phonelinegroup.line2.commonName=sales where=dategroup.startdate=2023-01-22,dategroup.enddate=2023-04-22

seperator

[String]

The column seperator, if nothing set the default seperator ',' will be used

Payload

None

Response

The created object.

Context

Authorization

User

Errors

Example

Request
POST https://xelion.nl/api/v1/master/queries/34345/generate_csv?where=phonelinegroup.linename=support
Response
{
    "object": {
        "commonName": "",
        "oid": "2122851",
        "objectType": "Attachment"
    },
    "links": [
        {
            "rel": "self",
            "method": "GET"
        }
    ]
}