# Query Collection

This endpoint can be used to extract one or more documents from a Xenioo Database Collection.&#x20;

### Requirements

To successfully invoke this endpoint :

1. A [Bot Level Authorization Token](https://docs10.xenioo.com/xenioo-api/globa-platform-api/authorization#bot-level-token-request) must be created and sent in the header.
2. An active Database package must be active on the target account.
3. The desired [collection ](https://docs10.xenioo.com/database/collections)must exist and must be flagged as [accessible through API](https://docs10.xenioo.com/collections#enable-api-access).

### Request

The following request shows how to extract a single document from a Xenioo Database Collection:

```bash
curl --location --request GET 'https://<NODE>.xenioo.com/data/<COLLECTIONNAME>/<DOCUMENT ID>' \
--header 'Authorization: Bearer <BOT AUTH TOKEN>' 
```

[URL Filtering Syntax](https://docs10.xenioo.com/database/database-api-access/url-filtering-syntax) can be used on the request in place of \<DOCUMENT ID> to extract multiple documents with a single call.

Multiple records can be retrieved without a filter specified by supplying a \* (asterisk) in place of a \<DOCUMENT ID> or URL Filtering query. Extraction of all documents with no filter specified is limited to 1024 documents.

### Response

If successful, this call will return the raw JSON of all the extracted records.

### Response Codes

This endpoint will reply with the following standard HTTP codes.

| Code | Meaning                                                                   |
| ---- | ------------------------------------------------------------------------- |
| 200  | Ok. The request has been successfully fulfilled.                          |
| 400  | Bad Request. The call does not contain the data required to be fulfilled. |
| 404  | Not Found. The specified collection has not been found.                   |
| 403  | Unauthorized. The specified collection cannot be access through API       |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs10.xenioo.com/database/database-api-access/query-collection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
