> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Default Order By

> Calculate the default orderby columns for a given provider and a search.

The search is specified by a storage type, provider name and storage key, and is fetched from the database. Default desired columns are then calculated for the search, and those columns are then used as the basis for calculating an order by. If you want to specify the desired columns directly, use the GetDefaultOrderByFromDesiredColumns method instead.  This is the same algorithm that is used by the Find service method.
NsApiSlow threshold: 5000 ms.



## OpenAPI

````yaml /openapi/agent/openapi-v3-FindAgent.json post /api/v1/Agents/Find/GetDefaultOrderBy
openapi: 3.0.0
info:
  version: v1-Agents
  title: SuperOffice Agent API v1
  description: SuperOffice Agent API - FindAgent
  contact:
    name: SuperOffice DevNet
    url: https://docs.superoffice.com/en/api/index.html
    email: sdk@superoffice.com
servers:
  - url: http://localhost:56350
  - url: https://localhost:56350
security: []
tags: []
externalDocs:
  description: >-
    The SuperOffice DevNet Community has more documentation, examples, and
    discussion forums.
  url: https://community.superoffice.com/en/developer/
paths:
  /api/v1/Agents/Find/GetDefaultOrderBy:
    post:
      tags:
        - Find_Agent
      summary: Get Default Order By
      description: "Calculate the default orderby columns for a given provider and a search.\n\nThe search is specified by a storage type, provider name and storage key, and is fetched from the database. Default desired columns are then calculated for the search, and those columns are then used as the basis for calculating an order by. If you want to specify the desired columns directly, use the GetDefaultOrderByFromDesiredColumns method instead.  This is the same algorithm that is used by the Find service method.\r\nNsApiSlow threshold: 5000 ms."
      operationId: v1FindAgent_GetDefaultOrderBy
      parameters:
        - name: $select
          in: query
          description: >-
            Optional comma separated list of properties to include in the
            result. Other fields are then nulled out to reduce payload size:
            "Name,department,category". Default = show all fields.
          required: false
          schema:
            type: string
        - name: Accept-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code.
          required: false
          schema:
            type: string
        - name: SO-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code. Overrides Accept-Language value.
          required: false
          schema:
            type: string
        - name: SO-Culture
          in: header
          description: >-
            Number, date formatting in a specified culture (iso2 language) code.
            Partially overrides SO-Language/Accept-Language value. Ignored if no
            Language set.
          required: false
          schema:
            type: string
        - name: SO-TimeZone
          in: header
          description: >-
            Specify the timezone code that you would like date/time responses
            converted to.
          required: false
          schema:
            type: string
        - name: SO-AppToken
          in: header
          description: >-
            The application token that identifies the partner app. Used when
            calling Online WebAPI from a server.
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.FindCarriers.GetDefaultOrderByRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.FindCarriers.GetDefaultOrderByRequest
          application/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.FindCarriers.GetDefaultOrderByRequest
          text/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.FindCarriers.GetDefaultOrderByRequest
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.FindCarriers.GetDefaultOrderByRequest
          application/json-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.FindCarriers.GetDefaultOrderByRequest
          application/merge-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.FindCarriers.GetDefaultOrderByRequest
        description: StorageType, ProviderName, StorageKey
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/SuperOffice.CRM.ArchiveLists.ArchiveOrderByInfo
            text/json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/SuperOffice.CRM.ArchiveLists.ArchiveOrderByInfo
            application/xml:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/SuperOffice.CRM.ArchiveLists.ArchiveOrderByInfo
            text/xml:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/SuperOffice.CRM.ArchiveLists.ArchiveOrderByInfo
            application/json-patch+json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/SuperOffice.CRM.ArchiveLists.ArchiveOrderByInfo
            application/merge-patch+json:
              schema:
                type: array
                items:
                  $ref: >-
                    #/components/schemas/SuperOffice.CRM.ArchiveLists.ArchiveOrderByInfo
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.WebApi.v1.Carriers.FindCarriers.GetDefaultOrderByRequest:
      description: >-
        GetDefaultOrderBy: Calculate the default orderby columns for a given
        provider and a search. The search is specified by a storage type,
        provider name and storage key, and is fetched from the database. Default
        desired columns are then calculated for the search, and those columns
        are then used as the basis for calculating an order by. If you want to
        specify the desired columns directly, use the
        GetDefaultOrderByFromDesiredColumns method instead.  This is the same
        algorithm that is used by the Find service method.
      type: object
      properties:
        StorageType:
          type: string
        ProviderName:
          type: string
        StorageKey:
          type: string
    SuperOffice.CRM.ArchiveLists.ArchiveOrderByInfo:
      description: >-
        This class carries information about an ordering criterion for an
        archive
      type: object
      properties:
        Name:
          description: >-
            Programmatic name of the column to order by, semantically the same
            as the ArchiveColumnInfo
            {SuperOffice.CRM.ArchiveLists.ArchiveColumnInfo.Name}.
          type: string
        Direction:
          description: Direction to order
          enum:
            - ASC
            - DESC
          type: string

````

## Related topics

- [Get Default Order By From Desired Columns](/en/api/reference/restful/agent/find_agent/get-default-order-by-from-desired-columns.md)
- [SuperOffice.WebApi.Data.Find GetDefaultOrderByRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Find_GetDefaultOrderByRequest.md)
- [SuperOffice.WebApi.Data.Find GetDefaultOrderByFromDesiredColumnsRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Find_GetDefaultOrderByFromDesiredColumnsRequest.md)
- [Find From Restrictions Columns Order By](/en/api/reference/restful/agent/find_agent/find-from-restrictions-columns-order-by.md)
- [NSFindAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSFindAgent.md)
- [SuperOffice.WebApi.Agents.IFindAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IFindAgent.md)
