> ## 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.

# Validate Script By Unique Id

> Validate a CRMScript.

This will check that the syntax is correct
<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/{cRMScriptUniqueId}/Validate
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/{cRMScriptUniqueId}/Validate:
    get:
      tags:
        - CRMScript
      summary: Validate Script By Unique Id
      description: "Validate a CRMScript.\n\nThis will check that the syntax is correct\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_ValidateScriptByUniqueId
      parameters:
        - name: cRMScriptUniqueId
          in: path
          description: The unique id of the CRMScript to validate
          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.CRMScriptResult'
            text/json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.CRMScriptResult'
            application/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.CRMScriptResult'
            text/xml:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.CRMScriptResult'
            application/json-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.CRMScriptResult'
            application/merge-patch+json:
              schema:
                $ref: '#/components/schemas/SuperOffice.CRM.Services.CRMScriptResult'
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    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.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.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.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

- [Validate Script By Unique Id](/en/api/reference/restful/agent/crmscript_agent/validate-script-by-unique-id.md)
- [SuperOffice.WebApi.Data.CRMScript ValidateScriptByUniqueIdRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.CRMScript_ValidateScriptByUniqueIdRequest.md)
- [Validate Trigger Script By Unique Id](/en/api/reference/restful/rest/triggerscript/validate-trigger-script-by-unique-id.md)
- [SuperOffice.WebApi.Data.CRMScript ValidateTriggerScriptByUniqueIdRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.CRMScript_ValidateTriggerScriptByUniqueIdRequest.md)
- [Save Trigger Script By Unique Id](/en/api/reference/restful/rest/triggerscript/save-trigger-script-by-unique-id.md)
