> ## 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 Pref Value

> Gets the preference value for specific section + key.

Returns the value defined closest to the user. Calls the Preference agent service GetPreferenceByName.



## OpenAPI

````yaml /openapi/rest/openapi-v3-Preference.json get /api/v1/Preference/{section}/{key}
openapi: 3.0.0
info:
  version: v1-REST
  title: SuperOffice REST API v1
  description: SuperOffice REST API - Preference
  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/Preference/{section}/{key}:
    get:
      tags:
        - Preference
      summary: Get Pref Value
      description: >-
        Gets the preference value for specific section + key.


        Returns the value defined closest to the user. Calls the Preference
        agent service GetPreferenceByName.
      operationId: v1Preference_GetPrefValue
      parameters:
        - name: section
          in: path
          description: The name of the preference section.
          required: true
          schema:
            type: string
        - name: key
          in: path
          description: The name of the preference key.
          required: true
          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
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.Preference'
            text/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.Preference'
            application/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.Preference'
            text/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.Preference'
            application/json-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.Preference'
            application/merge-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.Preference'
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.CRM.Services.Preference:
      description: "One preference item, which contains a specification (section/key), the raw string value, and the level at which this value was found.\r\n<para />\r\nCarrier object for Preference.\r\nServices for the Preference Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IPreferenceAgent\">Preference Agent</see>."
      type: object
      properties:
        Level:
          description: >-
            Preference level, using the standard enumerated type. Undefined is
            returned for preferences that do not have a current setting.
          enum:
            - Undefined
            - HardDefault
            - SystemWide
            - Database
            - Group
            - Individual
            - PC
          type: string
        RawValue:
          description: Preference value
          type: string
        Specification:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.PreferenceSpec'
        DisplayValue:
          description: >-
            Display value, populated when asked for. Suitable for binding
            display-datasource in lists, etc. Formatted using
            CultureDataFormatter.
          type: string
        DisplayTooltip:
          description: >-
            Display tooltip, populated when asked for. Suitable for binding
            display-datasource in lists, etc. Formatted using
            CultureDataFormatter.
          type: string
        DisplayType:
          description: Display type, populated when asked for.
          enum:
            - Unknown
            - Number
            - Text
            - Bool
            - ListOfValues
            - ListTableRef
            - TimeList
            - ContactID
            - PersonID
            - ProjectID
            - SelectionID
            - PosSize
            - TimeZone
            - Time
            - Password
            - MultiLineText
          type: string
        TabOrder:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.TabOrder'
        TargetId:
          format: int32
          description: >-
            The id of the target row. The table it points at is specified by the
            preference type.
          type: integer
        PrefDescId:
          format: int32
          description: The id of the prefdesc this preference is connected to
          type: integer
        TableName:
          description: >-
            For DisplayType=PrefDescValueType.ListTableRef, TableName will
            contain the name of the table which the value reference to.
          type: string
        UserPreferenceId:
          format: int32
          description: The id of the user preference
          type: integer
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Services.PreferenceSpec:
      description: "Preference specification, consisting of the section name and key name\r\n<para />\r\nCarrier object for PreferenceSpec.\r\nServices for the PreferenceSpec Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IPreferenceAgent\">Preference Agent</see>."
      type: object
      properties:
        Section:
          description: Preference section name
          type: string
        Key:
          description: Preference key name
          type: string
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Services.TabOrder:
      description: "Carrier object for TabOrder.\r\nServices for the TabOrder Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IPreferenceAgent\">Preference Agent</see>."
      type: object
      properties:
        TabOrderId:
          format: int32
          description: Primary key
          type: integer
        TabName:
          description: Name of tab control
          type: string
        Order:
          description: The actual tab order
          type: string
        AssociateId:
          format: int32
          description: Associate who owns this tab order
          type: integer
        TableRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.TableRight'
        FieldProperties:
          description: >-
            Field property dictionary mapping field names to field access
            rights.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldProperty'
    SuperOffice.CRM.Security.TableRight:
      description: "Wraps a table right together with an explanatory reason.\r\nCode can indicate why access is restricted."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string
    SuperOffice.CRM.Security.FieldProperty:
      description: >-
        Class holding properties like field length, field type about a field in
        the carrier.
      type: object
      properties:
        FieldRight:
          $ref: '#/components/schemas/SuperOffice.CRM.Security.FieldRight'
        FieldType:
          type: string
        FieldLength:
          format: int32
          description: ''
          type: integer
    SuperOffice.CRM.Security.FieldRight:
      description: "Wraps the field right together with an explanatory reason.\r\nAlso adds logical operators to the field rights so that they can be easily combined."
      type: object
      properties:
        Mask:
          type: string
        Reason:
          type: string

````

## Related topics

- [Get Pref Value At Level](/en/api/reference/restful/rest/preference/get-pref-value-at-level.md)
- [Get History Length Pref Value](/en/api/reference/restful/agent/viewstate_agent/get-history-length-pref-value.md)
- [Get Xsrf Value](/en/api/reference/restful/agent/preference_agent/get-xsrf-value.md)
- [Get Preferences With Display Values](/en/api/reference/restful/agent/preference_agent/get-preferences-with-display-values.md)
- [Get the current value of a given preference](/en/api/web-services/howto/user-preferences/get-preferences-preferenceagent.md)
- [Get Preference Description Line From Id And Value](/en/api/reference/restful/agent/preference_agent/get-preference-description-line-from-id-and-value.md)
