The "describeCodePackages" action returns all the current information about the specified code package names including source code and package properties.
Use "describeCodePackageHistory" to retrieve information about previous versions of a code package.
Request examples
Typical
{
"api": "admin",
"action": "describeCodePackages",
"params": {
"databaseName": "faircom",
"ownerName": "admin",
"codeNames": [ "convertTemperature" ],
"codeFormat": "utf8 | base64 | hex | byteArray | json"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}List a code package
{
"api": "admin",
"action": "describeCodePackages",
"params": {
"codeNames": ["convertTemperature"]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Response examples
Typical
{
"result": {
"data": [
{
"codeId": 4,
"databaseName": "faircom",
"ownerName": "admin",
"codeName": "convertTemperature",
"codeVersion": 2,
"clonedCodeId": 0,
"codeStatus": "deleted",
"codeLanguage": "javascript",
"codeType": "getRecordsTransform",
"description": "New description replaces old description.\nAnother description line.",
"metadata": {
"keyword": "temperature",
"favorites": true
},
"createdBy": "ADMIN",
"createdOn": "2024-10-15T19:29:34.216",
"updatedBy": "ADMIN",
"updatedOn": "2024-10-15T19:56:49.879",
"comment": "Modified the code and changed the name back",
"codeFormat": "utf8",
"code": "// The server runs this JavaScript code, which is registered in the server as a transform method.\nrecord.temperature_fahrenheit = record.source_payload.temperature\nrecord.temperature_celsius = getCelsiusFromFahrenheit(record.temperature_fahrenheit)\nrecord.temperature_status = calculateTemperatureStatus(record.temperature_fahrenheit)\n\nfunction getCelsiusFromFahrenheit(temperature_fahrenheit){\n return (temperature_fahrenheit - 32) / 1.8;\n}\n\nfunction calculateTemperatureStatus(temperature_fahrenheit){\n switch (true) {\n case (temperature_fahrenheit < 0):\n return \"alert: too cold\";\n case (temperature_fahrenheit < 32):\n return \"cold\";\n case (temperature_fahrenheit > 80):\n return \"hot\";\n case (temperature_fahrenheit > 140):\n return \"alert: too hot\";\n default:\n return \"normal\";\n }\n}"
}
]
},
"debugInfo": {
"request": {
"api": "admin",
"action": "describeCodePackages",
"params": {
"databaseName": "faircom",
"ownerName": "admin",
"codeNames": [
"convertTemperature"
],
"codeFormat": "utf8 | base64 | hex | byteArray | json"
},
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}List a code package
{
"result": {
"data": [
{
"codeId": 4,
"databaseName": "faircom",
"ownerName": "admin",
"codeName": "convertTemperature",
"codeVersion": 2,
"clonedCodeId": 0,
"codeStatus": "deleted",
"codeLanguage": "javascript",
"codeType": "getRecordsTransform",
"description": "New description replaces old description.\nAnother description line.",
"metadata": {
"keyword": "temperature",
"favorites": true
},
"createdBy": "ADMIN",
"createdOn": "2024-10-15T19:29:34.216",
"updatedBy": "ADMIN",
"updatedOn": "2024-10-15T19:56:49.879",
"comment": "Modified the code and changed the name back",
"codeFormat": "utf8",
"code": "// The server runs this JavaScript code, which is registered in the server as a transform method.\nrecord.temperature_fahrenheit = record.source_payload.temperature\nrecord.temperature_celsius = getCelsiusFromFahrenheit(record.temperature_fahrenheit)\nrecord.temperature_status = calculateTemperatureStatus(record.temperature_fahrenheit)\n\nfunction getCelsiusFromFahrenheit(temperature_fahrenheit){\n return (temperature_fahrenheit - 32) / 1.8;\n}\n\nfunction calculateTemperatureStatus(temperature_fahrenheit){\n switch (true) {\n case (temperature_fahrenheit < 0):\n return \"alert: too cold\";\n case (temperature_fahrenheit < 32):\n return \"cold\";\n case (temperature_fahrenheit > 80):\n return \"hot\";\n case (temperature_fahrenheit > 140):\n return \"alert: too hot\";\n default:\n return \"normal\";\n }\n}"
}
]
},
"debugInfo": {
"request": {
"api": "admin",
"action": "describeCodePackages",
"params": {
"codeNames": [
"convertTemperature"
]
},
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Properties
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
codeFormat |
The "codeFormat" property specifies the encoding of code in the code property. You must encode your code to embed it in a JSON string. "codeFormat" currently only supports the "utf8" encoding, requiring you to use JSON rules to escape problem characters in your code with the \ backslash character, such as \n. |
Optional with default of "utf8"
|
string | "utf8" |
codeNames |
The "params": {
"codeNames": [
"convertTemperature"
]
}, |
Required - No default value | array of strings | 1 or more strings |
databaseName |
The You specify this property when you want to use a different database instead of the default. Your session's account must have the appropriate privileges to access the code package. This property is useful because objects, such as tables and code packages, can have the same name in multiple databases. This feature allows you to create multiple environments in the same server and reuse the same JSON actions in each environment. For example, you can create It is an error to set If no default database is specified during |
Defaults to the session's "defaultDatabaseName" property |
string | 1 to 64 bytes |
ownerName |
The You specify this property when you want to use a different account instead of the default. Your session's account must have the appropriate privileges to access the code package. This property is useful because objects, such as tables and code packages, can have the same name in the same database as long as different accounts own each object. This feature allows you to create duplicate objects for different users on the same server and reuse the same JSON actions on those objects. For example, an administrator can copy objects from a production environment to her account so she can troubleshoot an issue using the same JSON actions, JavaScript, and SQL code. It is an error to set If no default owner is specified during |
Optional with default of the session's "defaultOwnerName" property |
string | 1 to 64 bytes |
Response properties ("result")
| Property | Description | Type | Limits (inclusive) |
|---|---|---|---|
data |
The |
array of objects | The action determines its contents. |
|
data .clonedCodeId |
The "result": {
"data": [
{
"codeId": 1,
"databaseName": "faircom",
"ownerName": "admin",
"codeName": "convertTemperature",
"codeVersion": 1,
"clonedCodeId": 0
]
}, |
integer | The cloned code ID. |
|
data .code |
The "code" property contains the source code. Before embedding it in a JSON string, encode the source code using the format specified in the "codeFormat" property. |
string | 1 to 8,388,096 bytes |
|
data .codeFormat |
The "codeFormat" property specifies the encoding of code in the code property. You must encode your code to embed it in a JSON string. "codeFormat" currently only supports the "utf8" encoding, requiring you to use JSON rules to escape problem characters in your code with the \ backslash character, such as \n. |
string | "utf8" |
|
data .codeId |
The "codeId" property specifies the unique numeric identifier of a code package. |
integer | No limit |
|
data .codeLanguage |
The "codeLanguage" property specifies the programming language of the code contained in the "code" property . Any string value is accepted. Currently, "javascript" and "json" are the only types of code the FairCom server can use. |
string |
|
|
data .codeName |
The It is an error to set The package's unique identifier is the combination of |
string | 1 to 64 bytes |
|
data .codeStatus |
The "codeStatus" property specifies a new status for the code. When you create a code package, it defaults to "developing". When you alter a code package, it defaults to the current state. You may set it to one of the following states: "developing", "deleted", "inactive", "deprecated", "testing", or "active". You can use "alterCodePackage" to transition from any state to any other. See "Use "codeStatus" to make a package runnable". |
string |
|
|
data .codeType |
The
|
string |
|
|
data .codeVersion |
The "result": {
"data": [
{
"codeId": 1,
"databaseName": "faircom",
"ownerName": "admin",
"codeName": "convertTemperature",
"codeVersion": 1,
"clonedCodeId": 0
]
}, |
integer | The version of the specified code package. |
|
data .comment |
The "comment" property explains the code change. |
string | 1 to 65,535 bytes |
|
data .createdBy |
The "result": {
"data": [
{
"createdBy": "ADMIN",
"createdOn": "2025-08-25T21:48:38.109",
"updatedBy": "ADMIN",
"updatedOn": "2025-08-25T21:48:38.109"
},
] |
string | The name of the account used to create the code package. |
|
data .createdOn |
The "result": {
"data": [
{
"createdBy": "ADMIN",
"createdOn": "2025-08-25T21:48:38.109",
"updatedBy": "ADMIN",
"updatedOn": "2025-08-25T21:48:38.109"
},
] |
timestamp | The date and time when the code package was created. |
|
data .databaseName |
The
|
string | 1 to 64 bytes |
|
data .description |
The Markdown is a good language for formatting description text. You must ensure the text is compatible with a JSON string. For example, you must escape a double quote character using the backslash character:
In the Thing API, It defaults to
|
string | 1 to 65,500 bytes |
|
data .metadata |
The |
JSON | 0 to 65,500 bytes |
|
data .ownerName |
The "ownerName" property identifies the user who owns an object (see Object owner). |
string | 0 to 64 bytes |
|
data .updatedBy |
The "result": {
"data": [
{
"createdBy": "ADMIN",
"createdOn": "2025-08-25T21:48:38.109",
"updatedBy": "ADMIN",
"updatedOn": "2025-08-25T21:48:38.109"
},
] |
string | The name of the account last used to update the code package. |
|
data .updatedOn |
The "result": {
"data": [
{
"createdBy": "ADMIN",
"createdOn": "2025-08-25T21:48:38.109",
"updatedBy": "ADMIN",
"updatedOn": "2025-08-25T21:48:38.109"
},
] |
timestamp | The date and time the code package was last updated. |