📘
TEOS User Guides
Contact CoreLedgerPrivacy Policy
TEOS API
TEOS API
  • 👋Welcome to TEOS API
  • Get started
  • TEOS API overview
    • Terms and concepts
      • Asset
      • Spark
      • Wallet
      • Supply
      • Warp
      • Invoice
      • Transaction
    • Architecture note
      • Tenant setup options
    • Authentication
    • Versioning
  • Using TEOS API
    • Postman examples
    • Rate limits
    • Dealing with blockchain transactions
      • How to get Ether for signing transactions
      • Transaction creation and submission
        • First transaction creation and submission for a new address on the private blockchain
    • Handling errors
      • 1xxxx codes
      • 2xxxx codes
      • 3xxxx codes
    • TEOS Events
    • Warp search
  • TEOS API references
    • TEOS API Swagger (OpenAPI)
  • Using additional APIs of TEOS Platform
    • User authentication flow with TEOS Authentication service and TMS
    • Device authorization flow with TxServer and TEOS Authentication service
    • Adding wallet to the TEOS Platform flow with TxServer and TEOS API
    • Using TxServer API
      • TxServer API (OpenAPI)
      • Key Pair Generation. Transaction Signing
      • Device Restoration
    • Using TEOS Authentication service
      • TEOS Authentication Service API
    • Using TMS API
      • TMS API Swagger (OpenAPI)
      • Handling errors
      • Changelog
    • Using Discovery Service
  • FAQ
  • Changelog
    • v0.9
    • Non-versioned changes
    • Previous versions (not supported)
  • Troubleshooting
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Using TEOS API

Handling errors

Error response structure, errors overview

Requests made to our APIs can result in several different error responses. The following document describes a list of error values with a map to the most common recovery tactic to use.

Error Responses

TEOS API is using HTTP status codes as a highest level of response codes. Following status codes can be returned by TEOS API:

  • HTTP 4xx - error on the client side

    • HTTP 400 - request body error(incorrect parameters, failed preconditions)

    • HTTP 401/403 - error with authentication/authorization

    • HTTP 404 - error in resource URI

  • HTTP 500 - internal server error

The following json-structure represents a common error response body resulting from a failed API request:

{
  "code": "21000",
  "message": "One or more preconditions failed",
  "target": "assets('090299f8f5d95aea86f280001')/destroyunits",
  "details": [
    {
      "code": "1006",
      "message": "not enough sparks on the balance. Address: 0xe0450ce1e2ef73b15514ae6a003b90d0ebac8835, required amount: 50, actual amount: 0",
      "arguments": {
        "signerAddress": "0xe0450ce1e2ef73b15514ae6a003b90d0ebac8835",
        "requiredAmount": "50",
        "actualAmount": "0"
      }
    }
  ],
  "clTraceId": "12a56f61-54f8-44fd-9f74-d0d2bbd942f6"
}

Where

  • code: high-level error code

  • message: a message, describing the issue

  • target: the path requested

  • details: depending on the error, may be present or not. They specify the details of the error.

    • code: the subcode of the issue

    • message: a message, describing the details of the issue

    • arguments: if a message contains any data (strings, decimals etc), that need to be used for i18n of the error message, this field contains the names and the values of the data

  • clTraceId: Internal support identifier. When reporting a bug related to a TEOS API call, include the clTraceId to help us find log data for debugging.

Error codes 1xxxx indicate non-business logic related issues with input (auth issues, issues with parsing input data, rate limiting etc.). These errors are mostly 'technical', related to the problems in the TEOS API consumer's code.

Error codes 2xxxx indicate business logic related issues with input (failed preconditions, validations etc.).

HTTP status
Code
Details.Code
Message

401

UserId was not found in provided authentication data

400

There were OData validation errors

400

Input binding failed

400

One or more preconditions failed

400

Asset with uinque Id '{uniqueAssetId}' does not exist

400

the user '{userId}' does not own asset ('uniqueAssetId') issuer's address '{assetIssuerAddress}'

400

invalid units amount provided (must be positive integer): '{providedAmount}'

400

spark factor is not defined for the asset '{uniqueAssetId}'

400

the user '{userId}' does not own signer address '{signerAddress}'

400

not enough sparks on the balance. Address: {signerAddress}, uniqueAssetId: {uniqueAssetId}, required amount: {requiredAmount}, actual amount: {actualAmount}

400

the instance is configured to operate on assets from ledger {configuredLedgerId}, but the requested asset '{uniqueAssetId}' is from ledger {assetLedgerId}

400

The source asset with Id '{sourceUniqueAssetId}' is already linked to asset with id '{targetUniqueAssetId}'

400

The source asset with Id '{sourceUniqueAssetId}' is not linked to asset with id '{targetUniqueAssetId}'

400

One or more validations failed

400

Either asset name or issuer address should be provided in search request

400

Issuer address value should be 40 or 42 symbol long

400

Valid language code should be provided for asset

400

Valid jurisdiction should be provided for asset

400

Asset's unit of measure is not valid

400

Asset's spark factor is not valid

400

Asset's asset class is not valid

400

The number of sections in asset custom definition item's SectionsPathNames differs from SectionsPath

400

Offered asset unqueId must be specified in request

400

Desired asset unqueId must be specified in request

400

Desired and offered assets unqueIds must differ

400

Either offered or desired amount of sparks must be specified in request but not both

400

Signer address must be specified

400

Input amount must be a positive integer

400

Array of supply ids must contain at least one supply id

400

Array of target unique asset ids must not be empty

400

User can delete only his own data

400

<Sdk error code>:<Sdk error message>

PreviousFirst transaction creation and submission for a new address on the private blockchainNext1xxxx codes

Last updated 1 year ago

Was this helpful?

11001
12001
12002
21000
21000
1001
21000
1002
21000
1003
21000
1004
21000
1005
21000
1006
21000
1007
21000
1008
21000
1009
22000
22000
2001
22000
2002
22000
2003
22000
2004
22000
2005
22000
2006
22000
2007
22000
2008
22000
2009
22000
2010
22000
2011
22000
2012
22000
2013
22000
2014
22000
2015
22000
2016
22000
2017
23000