Skip to main content
POST
/
library
/
v1beta1
/
{libId}
/
customScripts:compile
cURL
curl --request POST \
  --url https://aodocs.altirnao.com/api/library/v1beta1/{libId}/customScripts:compile \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "async": true,
  "code": {},
  "createdTime": "2023-11-07T05:31:56Z",
  "id": "<string>",
  "imports": [
    "<string>"
  ],
  "kind": "<string>",
  "language": "JAVA",
  "lastModifiedTime": "2023-11-07T05:31:56Z",
  "libraryId": "<string>",
  "name": "<string>",
  "parameters": [
    {
      "defaultValue": "<string>",
      "description": "<string>",
      "forcedValueForExistingBindings": "<string>",
      "name": "<string>"
    }
  ],
  "predefined": true,
  "runAs": "RUN_AS_SYSTEM",
  "type": "RELATION_FILTER"
}
'
{
  "compilationResult": "SUCCESS",
  "errorMessage": "<string>",
  "kind": "<string>"
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

libId
string
required

The ID of the library

Query Parameters

domain
string

The G Suite domain

securityCode
string

The security code

Body

application/json
async
boolean

Whether the script will be executed as an asynchronous task (JAVA only - Default: false)

code
object

The script code by method/function identifier

createdTime
string<date-time>

The time at which the custom script was created (read-only field)

id
string

The ID of the custom script (read-only field)

imports
string[]

The full list of imports used in the script (JAVA only)

kind
string
language
enum<string>

The language of the script which depends on the type (read-only field)

Available options:
JAVA,
JAVASCRIPT
lastModifiedTime
string<date-time>

The last time the custom script was modified by anyone (read-only field)

libraryId
string

The ID of the library (read-only field)

name
string

The name of the custom script, unique within a library

parameters
object[]

The list of arbitrary parameters that can be used in the script code

predefined
boolean

Whether the script is a predefined read-only script - (read-only field)

runAs
enum<string>

The permission context in which the script will be executed (JAVA only - Possible values: RUN_AS_SYSTEM, RUN_AS_USER - Default: RUN_AS_USER)

Available options:
RUN_AS_SYSTEM,
RUN_AS_USER
type
enum<string>

The type of the script, set during creation (Possible values: RELATION_FILTER, RELATION_RENDER, UPDATE, VIEWER, WORKFLOW_TRANSITION, REMINDER_CONDITION). Affects available methods.

Available options:
RELATION_FILTER,
RELATION_RENDER,
UPDATE,
VIEWER,
WORKFLOW_TRANSITION,
REMINDER_CONDITION

Response

200 - application/json

A ApiCustomScriptCompilationResponse response

compilationResult
enum<string>
Available options:
SUCCESS,
FAILURE
errorMessage
string
kind
string