> ## 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 C R M Script Entity

> Gets a CRMScriptEntity object.

Calls the CRMScript agent service GetCRMScriptEntity.
NsApiSlow threshold: 5000 ms.
<para />## Online Restricted: ## The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered.



## OpenAPI

````yaml /openapi/rest/openapi-v3-CRMScript.json get /api/v1/CRMScript/{id}
openapi: 3.0.0
info:
  version: v1-REST
  title: SuperOffice REST API v1
  description: SuperOffice REST API - CRMScript
  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/CRMScript/{id}:
    get:
      tags:
        - CRMScript
      summary: Get C R M Script Entity
      description: "Gets a CRMScriptEntity object.\n\nCalls the CRMScript agent service GetCRMScriptEntity.\r\nNsApiSlow threshold: 5000 ms.\r\n<para />## Online Restricted: ## The CRMScript agent is not available in Online by default. Access must be requested specifically when app is registered."
      operationId: v1CRMScriptEntity_GetCRMScriptEntity
      parameters:
        - name: id
          in: path
          description: The id of the CRMScriptEntity to return.
          required: true
          schema:
            format: int32
            type: integer
        - 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
      responses:
        '200':
          description: CRMScriptEntity found.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.WebApi.v1.Carriers.CRMScriptCarriers.CRMScriptEntityWithLinks
            text/json:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.WebApi.v1.Carriers.CRMScriptCarriers.CRMScriptEntityWithLinks
            application/xml:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.WebApi.v1.Carriers.CRMScriptCarriers.CRMScriptEntityWithLinks
            text/xml:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.WebApi.v1.Carriers.CRMScriptCarriers.CRMScriptEntityWithLinks
            application/json-patch+json:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.WebApi.v1.Carriers.CRMScriptCarriers.CRMScriptEntityWithLinks
            application/merge-patch+json:
              schema:
                $ref: >-
                  #/components/schemas/SuperOffice.WebApi.v1.Carriers.CRMScriptCarriers.CRMScriptEntityWithLinks
        '404':
          description: Not Found.
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.WebApi.v1.Carriers.CRMScriptCarriers.CRMScriptEntityWithLinks:
      description: "CRM Scripts - stored in the ejScript table, including source code.\r\n<para />\r\nCRMScriptEntity entity with API _Links added."
      type: object
      properties:
        EjscriptId:
          format: int32
          description: Primary key
          type: integer
        UniqueIdentifier:
          description: Global unique identifier, accross customers/tenants
          type: string
        Name:
          description: A description of this script
          type: string
        Description:
          description: Optional description of what this script is used for.
          type: string
        IncludeId:
          description: A unique name used for including this script in another
          type: string
        AccessKey:
          description: Access key used to run this script on the customer pages
          type: string
        HierarchyId:
          format: int32
          description: The script is inside this hierarchy folder
          type: integer
        Source:
          description: The script
          type: string
        SourceCode:
          description: Contains the source code of the script
          type: string
        ScriptType:
          description: The type/language of this script
          enum:
            - Unknown
            - CRMScript
            - JavaScript
          type: string
        HtmlOutput:
          format: int32
          description: True if this script will return HTML output
          type: integer
        Includes:
          description: >-
            The unique ids of all depencies of this script (all resolved
            includes)
          type: array
          items:
            format: int32
            type: integer
        SourceMaps:
          description: The source maps for this script
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.CRMScriptSourceMap'
        ValidationResult:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.CRMScriptResult'
        Registered:
          format: date-time
          description: Registered when  in UTC.
          type: string
        RegisteredAssociateId:
          format: int32
          description: Registered by whom
          type: integer
        Updated:
          format: date-time
          description: Last updated when  in UTC.
          type: string
        UpdatedAssociateId:
          format: int32
          description: Last updated by whom
          type: integer
        BlockedVerbs:
          description: The verbs that are blocked when calling a ejscript over HTTP
          enum:
            - BlockNone
            - BlockGET
            - BlockPOST
            - BlockPUT
            - BlockDELETE
            - BlockPATCH
            - BlockOPTIONS
            - BlockHEAD
            - BlockTRACE
            - BlockCONNECT
            - BlockOTHER
            - BlockAll
          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'
        _Links:
          type: object
          additionalProperties:
            type: string
    SuperOffice.CRM.Services.CRMScriptSourceMap:
      description: "Object for returning source-map info when validating or executing a CRMScript\r\n<para />\r\nCarrier object for CRMScriptSourceMap.\r\nServices for the CRMScriptSourceMap Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.ICRMScriptAgent\">CRMScript Agent</see>."
      type: object
      properties:
        LineNumberFrom:
          format: int32
          description: The 1-based start line (inclusive) of this entry
          type: integer
        LineNumberTo:
          format: int32
          description: The 1-based end line (inclusive) of this entry
          type: integer
        Delta:
          format: int32
          description: >-
            The delta between global line number and a line number inside this
            range
          type: integer
        IncludeId:
          description: The includeId for this entry
          type: string
        IncludedFrom:
          description: The list of IncludeId:linenum that leads to this source
          type: array
          items:
            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.CRMScriptResult:
      description: "Object for returning information when validating a CRMScript\r\n<para />\r\nCarrier object for CRMScriptResult.\r\nServices for the CRMScriptResult Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.ICRMScriptAgent\">CRMScript Agent</see>."
      type: object
      properties:
        Valid:
          description: >-
            True if the CRMScript was successfully validated. If false, see the
            error message for details
          type: boolean
        ErrorMessage:
          description: >-
            Deprecated, see ErrorInformation instead. Contains the error message
            for a non-valide CRMScript
          type: string
        LineNumber:
          format: int32
          description: >-
            Deprecated, see ErrorInformation instead. The line number containing
            the incorrect syntax, if available
          type: integer
        ErrorInformation:
          $ref: '#/components/schemas/SuperOffice.CRM.Services.CRMScriptErrorInfo'
        Transpiled:
          description: >-
            This will contain transpiled code. In case of Typescript, this will
            then contain the executable JavaScript
          type: string
        Includes:
          description: >-
            The unique ids of all depencies of this script (all resolved
            includes)
          type: array
          items:
            format: int32
            type: integer
        SourceMaps:
          description: >-
            Array of source maps showing where in the original code a specific
            line originated from
          type: array
          items:
            $ref: '#/components/schemas/SuperOffice.CRM.Services.CRMScriptSourceMap'
        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.Services.CRMScriptErrorInfo:
      description: "Object containing error information for a CRMScript\r\n<para />\r\nCarrier object for CRMScriptErrorInfo.\r\nServices for the CRMScriptErrorInfo Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.ICRMScriptAgent\">CRMScript Agent</see>."
      type: object
      properties:
        ErrorMessage:
          description: Descriptive message of the script failed
          type: string
        IncludeId:
          description: The includeId of the source where the error occured
          type: string
        LineNumber:
          format: int32
          description: The line number where the error occured
          type: integer
        CharacterPosition:
          format: int32
          description: The character position on the ErrorLine, if available
          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.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 C R M Script Entity](/en/api/reference/restful/agent/crmscript_agent/get-c-r-m-script-entity.md)
- [Get Trigger Script Entity](/en/api/reference/restful/rest/triggerscript/get-trigger-script-entity.md)
- [NSFormEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSFormEntity.md)
- [NSTicketEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSTicketEntity.md)
- [NSSaleEntity](/en/automation/crmscript/reference/CRMScript.NetServer.NSSaleEntity.md)
