Enable Item
Enable an existing Item. When an item is enabled it means it will be picked up in the queue to be detected for events and webhook/notification call. Usually this happens up to a maximum duration of 30min.
Request
POST https://api.arkhia.io/events/hedera/enable/:item/:x-api-key
HEADERS
x-api-secret | string | The Api Secret retrieved from an Arkhia project
PARAMETERS
item | string | `contract` or `ethtopic` or `account`
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` or `account`
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]
{
status: true,
response: {
id: 'clodtgmle000nf50iyf4f8t3i',
item_id: '0.0.5802863',
user_id: 'clod75irl0001fj0i1453nzwd',
network_id: 296,
type_id: 1,
enabled: true,
json_settings: { metadata: [Object], balance: [Object], expiration: [Object] },
status: 'QUEUED',
created_at: '2023-10-31T04:16:06.983Z',
updated_at: '2023-10-31T04:16:06.983Z',
job_health_timestamp: '1970-01-01T00:00:00.000Z',
request_fetch_limit: 100
}
}
Code Examples
cURL Examples
- cURL
- Node Js
Enable Account Event Settings
curl -X POST "https://api.arkhia.io/events/hedera/enable/account/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
}
}'
Enable Contract Event Settings
curl -X POST "https://api.arkhia.io/events/hedera/enable/contract/YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "x-api-secret: YOUR_API_SECRET" \
-d '{
"scoutSettings": {
"item_id": "0.0.789012",
"network_id": 295
}
}'
Enable EthTopic Event Settings
curl -X POST "https://api.arkhia.io/events/hedera/enable/ethtopic/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');// Enable Account Event Settingsconst enableAccountItem = async () => { const restApiUrl = `https://api.arkhia.io/events/hedera/enable/account/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); }}// Enable Contract Event Settingsconst enableContractItem = async () => { const restApiUrl = `https://api.arkhia.io/events/hedera/enable/contract/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.789012', network_id: 295 } }; try { const response = await axios.post(restApiUrl, bodyPayload, headers); return response; } catch(e) { console.error(e); }}// Enable EthTopic Event Settingsconst enableEthTopicItem = async () => { const restApiUrl = `https://api.arkhia.io/events/hedera/enable/ethtopic/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); }}