Get Events Config
Retrieve the current items and config available.
Request
POST https://api.arkhia.io/events/hedera/settings/:item/:config/:x-api-key
HEADERS
x-api-secret | string | The Api Secret retrieved from an Arkhia project
PARAMETERS
item | string | `contract` or `ethtopic`
config | string | `events`
x-api-key | string | The Api Key retrieved from an Arkhia project
BODY PAYLOAD
item_id | string | `contract` or `account` -> hedera_item_id , `ethtopic` as an eth topic
network_id | number | `295` (mainnet) or `296` (testnet)
HEADERS
x-api-secret | string | The Api Secret retrieved from an Arkhia project
PARAMETERS
item | string | `contract` or `ethtopic`
config | string | `events`
x-api-key | string | The Api Key retrieved from an Arkhia project
BODY PAYLOAD
item_id | string | `contract` or `account` -> hedera_item_id , `ethtopic` as an eth topic
network_id | number | `295` (mainnet) or `296` (testnet)
Response
- Operational [200]
- config_type : Type of configuration fetched.
- config_object : Events configuration and the one to be updated.
{
status: true,
response: {
{
item_id: '0.0.3931201',
network_id: 295,
item_type: 'contract',
config_type: 'events',
config_object: [
{
eventId: '0.0.3931201_Event_1',
eventName: '0.0.3931201_event_1',
eventRules: []
}
],
config_object_template: '<link_here_soon>'
}
}
}
Code Examples
cURL Examples
- cURL
- Node Js
Get Contract Events Configuration
curl -X POST "https://api.arkhia.io/events/hedera/settings/contract/events/YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-api-secret: YOUR_API_SECRET" \
-d '{
"scoutSettings": {
"item_id": "0.0.123456",
"network_id": 295
}
}'
Get Contract ABI Configuration
curl -X POST "https://api.arkhia.io/events/hedera/settings/contract/abi/YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-api-secret: YOUR_API_SECRET" \
-d '{
"scoutSettings": {
"item_id": "0.0.123456",
"network_id": 295
}
}'
Get EthTopic Events Configuration
curl -X POST "https://api.arkhia.io/events/hedera/settings/ethtopic/events/YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-api-secret: YOUR_API_SECRET" \
-d '{
"scoutSettings": {
"item_id": "0x1234567890123456789012345678901234567890123456789012345678901234",
"network_id": 296
}
}'
const axios = require('axios');// Get Contract Events Configurationconst getContractEventsConfig = async () => { const restApiUrl = `https://api.arkhia.io/events/hedera/settings/contract/events/YOUR_API_KEY`; const apiSecret = `YOUR_API_SECRET`; const headers = { headers: { "x-api-secret": apiSecret, "Content-Type": "application/json" } }; const bodyPayload = { scoutSettings: { item_id: '0.0.123456', network_id: 295 } }; try { const response = await axios.post(restApiUrl, bodyPayload, headers); return response; } catch(e) { console.error(e); }}// Get Contract ABI Configurationconst getContractABIConfig = async () => { const restApiUrl = `https://api.arkhia.io/events/hedera/settings/contract/abi/YOUR_API_KEY`; const apiSecret = `YOUR_API_SECRET`; const headers = { headers: { "x-api-secret": apiSecret, "Content-Type": "application/json" } }; const bodyPayload = { scoutSettings: { item_id: '0.0.123456', network_id: 295 } }; try { const response = await axios.post(restApiUrl, bodyPayload, headers); return response; } catch(e) { console.error(e); }}// Get EthTopic Events Configurationconst getEthTopicEventsConfig = async () => { const restApiUrl = `https://api.arkhia.io/events/hedera/settings/ethtopic/events/YOUR_API_KEY`; const apiSecret = `YOUR_API_SECRET`; const headers = { headers: { "x-api-secret": apiSecret, "Content-Type": "application/json" } }; const bodyPayload = { scoutSettings: { item_id: '0x1234567890123456789012345678901234567890123456789012345678901234', network_id: 296 } }; try { const response = await axios.post(restApiUrl, bodyPayload, headers); return response; } catch(e) { console.error(e); }}