Ontology Developer Center
DISCOVERCOMMUNITYSUPPORT
  • Introduction
  • Discover Ontology
  • Getting Started
  • Glossary
  • Decentralized Identity and Data
    • ONT ID
      • Decentralized Identifiers
        • Method Specification for Ontology
        • Method Specification for Ethereum
        • Method Specification for BSC
      • Verifiable Credentials
        • Anonymous Credentials
      • ONT Login
        • Scenarios
        • Protocol Specification
        • Front-end JavaScript SDK
          • Integration and Usage
          • API Reference
        • Front-end UI SDK
          • Integration and Usage
          • API Reference
        • Back-end Go SDK
          • Integration and Usage
          • API Reference
        • Back-end Java SDK
          • Integration and Usage
          • API Reference
      • ONT TAG
        • Workflow
        • API Reference
      • Mercury
      • OScore
    • DDXF
      • Components and Interfaces
      • GREP
      • Overall Scheme
      • Solutions
        • Marketplace
          • Deployment
          • Scenarios
          • SaaS Tenant
          • Java SDK
        • Data Storage
          • Deployment
          • Java SDK
        • Resource Auditor
        • Offline Judge
      • Use Cases
        • E-Shops
  • ONTOLOGY ELEMENTS
    • Smart Contracts
      • Types of smart contracts
    • Token Protocols
    • Consensus Mechanism
    • Ontology Oracle
      • Oracle Process Flow
  • GUIDES & TUTORIALS
    • Development Guides
      • dApp Development
        • Using the dAPI
        • Data Synchronization
      • Smart Contract Development
        • EVM Contract
          • Development Environment and Tools
          • Wallet Setup
          • Contract Development
          • How to Deploy a Smart Contract with GetBlock
        • NeoVM Contract
          • Development tools and environment
          • Launching the IDE
          • Writing and editing program logic
          • Deploying and testing on private net
        • WASM Contract
          • Development Environment
          • Project Initiation - Hello World
          • Creating your own project
          • Development using SmartX
          • Runtime API
          • Contract Fundamentals
          • Inter-contract Interaction
          • Developing Contracts in C++
        • Publish Contract Source Code
    • Integration Guides
      • dApp Integration
        • dAPI Integration
          • Chrome Plugin
          • Mobile wallet dApp
          • QR code mechanism
          • Wake call mechanism
        • Cocos 2D-x
        • Unity 3D applications
      • Mobile Wallet Integration
        • SDK integration
        • dAPI Integration
          • In-wallet applications
          • QR code mechanism
          • Wake call mechanism
        • Stake
      • Using ONT ID
      • Exchange Integration
        • Exchange Docking Guide
        • Exchange API
      • Ontology for dApp Stores
    • EVM & Token Decimals Upgrade
  • ONTOLOGY NODE
    • Abstract
    • Node Deployment
      • Standard Node
      • Rosetta Node
    • Interacting with a Public Node
  • DEVELOPER TOOLS
    • dApp Development Framework
      • Punica CLI
      • Punica boxes
      • Solo Chain
    • IDE
    • APIs
      • HTTP API
        • Restful
        • WebSocket
        • Remote Procedure Call (RPC)
      • Explorer v2 API
        • Block
        • Address
        • Contract
        • Token
        • Transactions
        • ONT ID
        • Summary
        • Node
      • Native Token API
        • ONT Contract API
        • ONG Contract API
      • ONT ID Contract API
      • Web3 API
      • OScore Open API
      • Rosetta Node API
        • Data API
        • Construction API
      • DToken Contract API
      • DDXF
        • Marketplace Contract API
        • Storage API
      • Governance API
    • Digital Wallet
      • Chrome Plugin provider
      • Chrome Plugin dAPI
      • Mobile version provider
      • Mobile version dAPI
    • SDKs
    • Signing Server
      • Installation
      • API reference
  • COMMUNITY
    • Ecosystem Programs
    • Community Libraries
    • Community Events
    • Community Channels
    • Core Contributors
  • SUPPORT
    • FAQ
      • Basic blockchain concepts
      • Ontology Nodes
      • Ontology token protocols
      • Smart contracts
      • SDKs and APIs
    • Contact Us
Powered by GitBook
On this page
  • Request Particulars
  • Fetch User's Asset Score
  • Fetch User's Asset Score Details

Was this helpful?

  1. DEVELOPER TOOLS
  2. APIs

OScore Open API

OScore API reference

PreviousWeb3 APINextRosetta Node API

Last updated 8 months ago

Was this helpful?

OScore is a digital asset score that is calculated based on the assigned to each wallet account on the Ontology chain. The score can be queried by sending requests to the following public APIs.

Request Particulars

  1. The timestamp sent in the request is only valid for 30 seconds. In case this threshold is exceeded the error code 62020 will be sent in the response.

  2. The request needs to be signed by the respective ONT ID. The back end carries out signature verification. If verification fails, the 62006 error code will be sent in response.

  3. The ONT ID and timestamp are concatenated together to obtain the signature content. The signature is a base64 string. For example, for ont_id=did:ont:AaRxdnJA5mArpFr1CA7RhT9AYrXdRgNqWm and timestamp=1596164819, the ONT ID's private key is used to sign the signature data and generate the base64 string. The data to be signed is did:ont:AaRxdnJA5mArpFr1CA7RhT9AYrXdRgNqWm1596164819

The base URL used to send the requests is

Fetch User's Asset Score

This method can be used to fetch a user's asset score by passing the ONT ID.

Method: POST

URL: /v2/ontoservice/asset_score

Request:

{
  "ont_id": "did:ont:AaRxdnJA5mArpFr1CA7RhT9AYrXdRgNqWm",
  "signature": "AYAMGuzl1lh4VQ6PbIQIa2M....fvs6VIfhBfYD4HkqqIGE=",
  "timestamp": 1596164819 // UNIX timestamp
}

Response:

{
  "Action": "",
  "Error": 0,
  "Desc": "SUCCESS",
  "Version": "1.0",
  "Result": {
    "score": "400"
  }
}

Fetch User's Asset Score Details

This method can be used to fetch details regarding a user's asset score by passing the ONT ID.

Method: POST

URL: /v2/ontoservice/asset_score/detail

Request:

{
  "ont_id": "did:ont:AaRxdnJA5mArpFr1CA7RhT9AYrXdRgNqWm",
  "signature": "AYAMGuzl1lh4VQ6PbIQIa2M....fvs6VIfhBfYD4HkqqIGE=",
  "timestamp": 1596164819
}

Response:

{
  "Action": "",
  "Error": 0,
  "Desc": "SUCCESS",
  "Version": "1.0",
  "Result": {
    "snapshot_asset_avg_usd": "0",
    "asset_usd": "0",
    "exchange_asset_usd": "0"
  }
}

Field

Type

Description

snapshot_asset_avg_usd

String

Daily average asset value for all accounts in USD

asset_usd

String

Current asset value in USD

exchange_asset_usd

String

Total assets in exchange wallet accounts in USD

https://service.onto.app/S5