Skip to main content
GET
/
platform
/
admin
/
smart_contract_implementations
/
{id}
/
prepare-update
Prepare smart contract implementation update
curl --request GET \
  --url https://api.example.com/platform/admin/smart_contract_implementations/{id}/prepare-update
{
  "isSuccess": true,
  "isFailure": false,
  "error": null,
  "value": {
    "id": 42,
    "name": "Example"
  }
}

Description

Returns the current smart contract implementation data needed to prepare an update form. This endpoint retrieves the existing description and metadata template JSON for a specific implementation, allowing administrators to view and modify these values before submitting an update request.

Input

  • id (long, required) - The unique identifier of the smart contract implementation to prepare for update.

Output

Returns a SmartContractImplementationUpdateModel containing:
  • id (long) - Unique identifier of the implementation.
  • description (string) - Current description prefixed with implementation type (e.g., “IssuerFactoryImplementation Factory contract…”).
  • metadataTemplateJson (string) - Current JSON template for contract metadata configuration (empty string if not set).

Examples

Request
GET /api/platform/smart-contract-implementations/1/prepare-update
Authorization: Bearer {token}
Response (200 OK)
{
  "data": {
    "id": 1,
    "description": "IssuerFactoryImplementation Factory contract for creating token issuers with ownership controls",
    "metadataTemplateJson": "{\"version\": \"1.0\", \"features\": [\"ownership\", \"factory\"]}"
  }
}

Errors

  • 400 Bad Request: Invalid implementation ID format or negative value.
  • 401 Unauthorized: Missing or invalid authentication token.
  • 403 Forbidden: User lacks platform administrator privileges.
  • 404 Not Found: Smart contract implementation with specified ID does not exist.
  • 500 Internal Server Error: Unexpected system error occurred.

Notes

Requires platform administrator privileges. The description returned includes the implementation type as a prefix for context. If no metadata template was previously set, the metadataTemplateJson field will be an empty string. This endpoint is typically called before displaying an update form to pre-populate fields with current values.

Path Parameters

id
integer<int64>
required

Unique identifier of the smart contract implementation to prepare for update.

Query Parameters

api-version
string | null

Response

Update preparation data retrieved successfully.

Wrapper for API operation results containing success status, error information, and return value.

isSuccess
boolean

True if the operation completed successfully, false otherwise.

Example:

true

isFailure
boolean

True if the operation failed, false otherwise.

Example:

false

error
object

Error information returned when the operation fails.

Example:
{
"code": "ValidationError",
"message": "The request parameters failed validation.",
"info": [
"The Name field is required.",
"The Id field must be greater than 0."
]
}
value
object

The result value returned when the operation is successful.

Example:
{}