Hi everyone,
I am using the Aptos Rest API to execute a view function of a module.
However, it always return 400 error.
Here’s sample module on Testnet.
Aptos Code: return number 2.
#[view]
public fun ret_text_v3(): u64{
2
}
I used the rest API to submit the request : Aptos REST API
API URL: https://fullnode.testnet.aptoslabs.com/v1
/view
API Params:
{
function: “0xf0f627544963910cf55a51d4fd87973e3a60b45ef2173db8b45362631e7ee668::swap::ret_text_v3”,
arguments: ,
type_arguments:
};
Return: 400 Bad Request
{
“message”: “PartialVMError with status INVALID_MAIN_FUNCTION_SIGNATURE and message function not marked as view function”,
“error_code”: “invalid_input”,
“vm_error_code”: null
}
Can everyone help with the root cause of it?
Thank you so much