> For the complete documentation index, see [llms.txt](https://docs.hos.accessacloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hos.accessacloud.com/atreemo-api/api-reference/atreemo-api-reference/selection.md).

# Selection

Api Methods for Selection

## GetCubeSelection

> Loads the saved selection definition for SelectionID and the supplied UserID, then asks the cube service for its result count. Returns the recursive Result tree, SelectionCount, Response and Error. The count is service-computed, not the number of child nodes. This description does not grant permission to choose another user's context or establish the deployed service's access rules.

```json
{"openapi":"3.0.3","info":{"title":"Atreemo API","version":"0.1.0"},"tags":[{"name":"Selection","description":"Api Methods for Selection"}],"servers":[{"url":"https://apim-hospitality-dev-uksouth.azure-api.net/atreemo-api","description":"Local DEV APIM import draft only; not a deployed endpoint announcement."}],"security":[{"AtreemoBearer":[]}],"components":{"securitySchemes":{"AtreemoBearer":{"type":"http","scheme":"bearer","description":"Atreemo access token obtained by the caller from the Atreemo instance `POST /token` endpoint (OAuth2 password grant) and sent as `Authorization: Bearer <token>`. See the Authorisation guide."}},"schemas":{"GetCubeSelectionInput":{"type":"object","nullable":true,"properties":{"SelectionID":{"type":"integer","format":"int32"},"UserID":{"type":"integer","format":"int32"}},"description":"Source-backed JSON members, including inheritance and JSON naming/ignore attributes. No property is required solely because its CLR value type is non-nullable. Runtime and deployment alignment are unverified."},"GetCubeSelectionOutput":{"type":"object","properties":{"Error":{"type":"array","items":{"type":"string"},"description":"The list of errors description"},"Response":{"type":"boolean","description":"The status of the call"},"Result":{"allOf":[{"$ref":"#/components/schemas/CubeSelection"}],"description":"Recursive selection definition; may be null on a failed call."},"SelectionCount":{"type":"integer","format":"int32","description":"Value assigned from WebCubes.NbAnswerSel_Ext; do not infer it from the number of Items nodes."}}},"CubeSelection":{"type":"object","nullable":true,"description":"Recursive selection definition from AtreemoServiceTools.WcfWebCube. The generated Serializable class is combined with the JsonObject(MemberSerialization.OptOut) partial, so JSON uses these public property names, not private storage fields or the PropertyChanged event. No property presence is inferred solely from CLR non-nullability. Project compile inclusion is verified; assembled/deployed serialization remains unverified.","properties":{"ItemID":{"type":"integer","format":"int32"},"CritID":{"type":"integer","format":"int32"},"CritType":{"type":"integer","format":"int32","description":"Numeric JSON enum representation. Named source values are listed, but the declaration does not prove rejection of other integers."},"CritSQL":{"type":"string","nullable":true},"CritSQL222":{"type":"string","nullable":true},"UniqueID":{"type":"integer","format":"int32"},"Items":{"type":"array","nullable":true,"items":{"type":"object","nullable":true,"additionalProperties":true,"description":"APIM import-only relaxation of the recursive CubeSelection child reference. Child object structure is open because APIM does not support recursive schema definitions. The full recursive contract is preserved in reference/openapi.yaml. No maximum recursion depth, payload transformation or runtime compatibility is implied."}}}}}},"paths":{"/api/Selection/GetCubeSelection":{"post":{"operationId":"SelectionGetCubeSelection","summary":"GetCubeSelection","tags":["Selection"],"description":"Loads the saved selection definition for SelectionID and the supplied UserID, then asks the cube service for its result count. Returns the recursive Result tree, SelectionCount, Response and Error. The count is service-computed, not the number of child nodes. This description does not grant permission to choose another user's context or establish the deployed service's access rules.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCubeSelectionInput"}}}},"responses":{"200":{"description":"Source return path at the pinned commit; the example is synthetic and runtime behaviour is unverified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCubeSelectionOutput"}}}}}}}}}
```

## GetSelectionResult

> Get Selection result

```json
{"openapi":"3.0.3","info":{"title":"Atreemo API","version":"0.1.0"},"tags":[{"name":"Selection","description":"Api Methods for Selection"}],"servers":[{"url":"https://apim-hospitality-dev-uksouth.azure-api.net/atreemo-api","description":"Local DEV APIM import draft only; not a deployed endpoint announcement."}],"security":[{"AtreemoBearer":[]}],"components":{"securitySchemes":{"AtreemoBearer":{"type":"http","scheme":"bearer","description":"Atreemo access token obtained by the caller from the Atreemo instance `POST /token` endpoint (OAuth2 password grant) and sent as `Authorization: Bearer <token>`. See the Authorisation guide."}},"schemas":{"GetSelectionResultInput":{"type":"object","properties":{"FormatID":{"type":"integer","format":"int32","description":"The Export format ID"},"IsContactSelection":{"type":"boolean","description":"Whether the selection is for contacts."},"SelectionID":{"type":"integer","format":"int32","description":"The ID of the Selection"},"UserID":{"type":"integer","format":"int32","nullable":true},"Filter":{"allOf":[{"$ref":"#/components/schemas/SelectionCriteria"}]}},"description":"Source-backed members. No property is required solely because its CLR type is non-nullable."},"SelectionCriteria":{"type":"object","nullable":true,"properties":{"CriteriaID":{"type":"integer","format":"int32"},"IsSelection":{"type":"boolean"}}},"GetSelectionResultOutput":{"type":"object","properties":{"Error":{"type":"array","items":{"type":"string"},"description":"The list of errors description"},"Response":{"type":"boolean","description":"The status of the call"},"Result":{"description":"The IDs belongs in this selection (Documented as type `DataTable`; its structure or allowed values are not documented in the public collection.) Json.NET DataTable wire shape is an array of row objects. Columns depend on FormatID and [Atreemo].[Generate_ExportTable], [Atreemo].[ExecuteDynamicQuery], [Atreemo].[GetDataFromExportTable] (ApiController/SelectionController.cs:462-485,625-648,764-810); no universal row properties can be asserted.","type":"array","items":{"type":"object","additionalProperties":true}}}}}},"paths":{"/api/Selection/GetSelectionResult":{"post":{"operationId":"SelectionGetSelectionResult","summary":"GetSelectionResult","tags":["Selection"],"description":"Get Selection result","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSelectionResultInput"}}}},"responses":{"200":{"description":"OK (sample status in the public collection).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSelectionResultOutput"}}}}}}}}}
```

## GetSelectionResult\_Ext

> Get Selection result

```json
{"openapi":"3.0.3","info":{"title":"Atreemo API","version":"0.1.0"},"tags":[{"name":"Selection","description":"Api Methods for Selection"}],"servers":[{"url":"https://apim-hospitality-dev-uksouth.azure-api.net/atreemo-api","description":"Local DEV APIM import draft only; not a deployed endpoint announcement."}],"security":[{"AtreemoBearer":[]}],"components":{"securitySchemes":{"AtreemoBearer":{"type":"http","scheme":"bearer","description":"Atreemo access token obtained by the caller from the Atreemo instance `POST /token` endpoint (OAuth2 password grant) and sent as `Authorization: Bearer <token>`. See the Authorisation guide."}},"schemas":{"GetSelectionResultInputExt":{"type":"object","properties":{"FormatID":{"type":"integer","format":"int32","description":"The Export format ID"},"IsContactSelection":{"type":"boolean","description":"Whether the selection is for contacts."},"Selection":{"allOf":[{"$ref":"#/components/schemas/CubeSelection"}],"description":"Source-declared recursive CubeSelection definition; build/runtime alignment is separately unverified."},"UserID":{"type":"integer","format":"int32","nullable":true},"Filter":{"allOf":[{"$ref":"#/components/schemas/SelectionCriteria"}]},"TableName":{"type":"string","nullable":true},"OFFSET":{"type":"integer","format":"int32"},"IncludeDeletedContacts":{"type":"boolean","nullable":true},"ReturnCountOnly":{"type":"boolean","nullable":true}},"description":"Source-backed members, including the recursive CubeSelection declaration. Defaults and requiredness are not inferred from CLR non-nullability; build/runtime alignment remains unverified."},"CubeSelection":{"type":"object","nullable":true,"description":"Recursive selection definition from AtreemoServiceTools.WcfWebCube. The generated Serializable class is combined with the JsonObject(MemberSerialization.OptOut) partial, so JSON uses these public property names, not private storage fields or the PropertyChanged event. No property presence is inferred solely from CLR non-nullability. Project compile inclusion is verified; assembled/deployed serialization remains unverified.","properties":{"ItemID":{"type":"integer","format":"int32"},"CritID":{"type":"integer","format":"int32"},"CritType":{"type":"integer","format":"int32","description":"Numeric JSON enum representation. Named source values are listed, but the declaration does not prove rejection of other integers."},"CritSQL":{"type":"string","nullable":true},"CritSQL222":{"type":"string","nullable":true},"UniqueID":{"type":"integer","format":"int32"},"Items":{"type":"array","nullable":true,"items":{"type":"object","nullable":true,"additionalProperties":true,"description":"APIM import-only relaxation of the recursive CubeSelection child reference. Child object structure is open because APIM does not support recursive schema definitions. The full recursive contract is preserved in reference/openapi.yaml. No maximum recursion depth, payload transformation or runtime compatibility is implied."}}}},"SelectionCriteria":{"type":"object","nullable":true,"properties":{"CriteriaID":{"type":"integer","format":"int32"},"IsSelection":{"type":"boolean"}}},"GetSelectionResultOutput_Ext":{"type":"object","properties":{"Error":{"type":"array","items":{"type":"string"},"description":"The list of errors description"},"Response":{"type":"boolean","description":"The status of the call"},"Result":{"description":"The IDs belongs in this selection (Documented as type `DataTable`; its structure or allowed values are not documented in the public collection.) Json.NET DataTable wire shape is an array of row objects. Columns depend on FormatID and [Atreemo].[Generate_ExportTable], [Atreemo].[ExecuteDynamicQuery], [Atreemo].[GetDataFromExportTable] (ApiController/SelectionController.cs:462-485,625-648,764-810); no universal row properties can be asserted.","type":"array","items":{"type":"object","additionalProperties":true}}}}}},"paths":{"/api/Selection/GetSelectionResult_Ext":{"post":{"operationId":"SelectionGetSelectionResultExt","summary":"GetSelectionResult_Ext","tags":["Selection"],"description":"Get Selection result","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSelectionResultInputExt"}}}},"responses":{"200":{"description":"OK (sample status in the public collection).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSelectionResultOutput_Ext"}}}}}}}}}
```

## GetSelectionResultWithUserFilter

> Get Selection result

```json
{"openapi":"3.0.3","info":{"title":"Atreemo API","version":"0.1.0"},"tags":[{"name":"Selection","description":"Api Methods for Selection"}],"servers":[{"url":"https://apim-hospitality-dev-uksouth.azure-api.net/atreemo-api","description":"Local DEV APIM import draft only; not a deployed endpoint announcement."}],"security":[{"AtreemoBearer":[]}],"components":{"securitySchemes":{"AtreemoBearer":{"type":"http","scheme":"bearer","description":"Atreemo access token obtained by the caller from the Atreemo instance `POST /token` endpoint (OAuth2 password grant) and sent as `Authorization: Bearer <token>`. See the Authorisation guide."}},"schemas":{"GetSelectionResultWithUserFilterInput":{"type":"object","properties":{"FormatID":{"type":"integer","format":"int32","description":"The Export format ID"},"IsContactSelection":{"type":"boolean","description":"Whether the selection is for contacts."},"Selection":{"allOf":[{"$ref":"#/components/schemas/CubeSelection"}],"description":"Source-declared recursive CubeSelection definition used by the action; build/runtime alignment is separately unverified."},"UserID":{"type":"integer","format":"int32","nullable":true,"description":"When supplied and positive, the action applies the user's environment filter; this is not proof that the caller can choose any user's permissions."}},"description":"Source-backed members. Selection and UserID were missing from the published-table-derived draft; no property presence requirement is inferred solely from CLR types."},"CubeSelection":{"type":"object","nullable":true,"description":"Recursive selection definition from AtreemoServiceTools.WcfWebCube. The generated Serializable class is combined with the JsonObject(MemberSerialization.OptOut) partial, so JSON uses these public property names, not private storage fields or the PropertyChanged event. No property presence is inferred solely from CLR non-nullability. Project compile inclusion is verified; assembled/deployed serialization remains unverified.","properties":{"ItemID":{"type":"integer","format":"int32"},"CritID":{"type":"integer","format":"int32"},"CritType":{"type":"integer","format":"int32","description":"Numeric JSON enum representation. Named source values are listed, but the declaration does not prove rejection of other integers."},"CritSQL":{"type":"string","nullable":true},"CritSQL222":{"type":"string","nullable":true},"UniqueID":{"type":"integer","format":"int32"},"Items":{"type":"array","nullable":true,"items":{"type":"object","nullable":true,"additionalProperties":true,"description":"APIM import-only relaxation of the recursive CubeSelection child reference. Child object structure is open because APIM does not support recursive schema definitions. The full recursive contract is preserved in reference/openapi.yaml. No maximum recursion depth, payload transformation or runtime compatibility is implied."}}}},"GetSelectionResultOutput":{"type":"object","properties":{"Error":{"type":"array","items":{"type":"string"},"description":"The list of errors description"},"Response":{"type":"boolean","description":"The status of the call"},"Result":{"description":"The IDs belongs in this selection (Documented as type `DataTable`; its structure or allowed values are not documented in the public collection.) Json.NET DataTable wire shape is an array of row objects. Columns depend on FormatID and [Atreemo].[Generate_ExportTable], [Atreemo].[ExecuteDynamicQuery], [Atreemo].[GetDataFromExportTable] (ApiController/SelectionController.cs:462-485,625-648,764-810); no universal row properties can be asserted.","type":"array","items":{"type":"object","additionalProperties":true}}}}}},"paths":{"/api/Selection/GetSelectionResultWithUserFilter":{"post":{"operationId":"SelectionGetSelectionResultWithUserFilter","summary":"GetSelectionResultWithUserFilter","tags":["Selection"],"description":"Get Selection result","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSelectionResultWithUserFilterInput"}}}},"responses":{"200":{"description":"OK (sample status in the public collection).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSelectionResultOutput"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hos.accessacloud.com/atreemo-api/api-reference/atreemo-api-reference/selection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
