---
title: "Call a view function on a contract by Hname"
method: POST
path: "/v1/chains/{chainID}/callview"
tags: ["chains"]
---

# Call a view function on a contract by Hname

`POST /v1/chains/{chainID}/callview`

Execute a view call. Either use HName or Name properties. If both are supplied, HName are used.

## Path parameters

- `chainID` string, string, required

## Request body

- ContractCallViewRequest
  - `arguments` JSONDict, required
    - `Items` Item[]
      - `key` string, string, required — key (hex-encoded)
      - `value` string, string, required — value (hex-encoded)
  - `block` string, string
  - `contractHName` string, string, required — The contract name as HName (Hex)
  - `contractName` string, string, required — The contract name
  - `functionHName` string, string, required — The function name as HName (Hex)
  - `functionName` string, string, required — The function name

## Response `200`

Result

- JSONDict
  - `Items` Item[]
    - `key` string, string, required — key (hex-encoded)
    - `value` string, string, required — value (hex-encoded)

## Changes

- **2023-07-07** `992c016b4b67` — 1 info
  - added the new optional request property `block`
- **2023-04-19** `bcfc1e976f0e` — 2 info
  - api tag `chains` added
  - api tag `requests` removed
- **2023-04-18** `c9496d92ca5b` — 1 info
  - endpoint added
- **2023-02-13** `1041f915f260` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/iotaledger/apis/wasp-api/changes/v1/chains/:chainID/callview/post.md)

---

[API](https://skmtc.dev/iotaledger/apis/wasp-api.md) · [All operations](https://skmtc.dev/iotaledger/apis/wasp-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/iotaledger/wasp-api/revisions/994a6c93b890/schema)
