Triggers
ENDPOINTS |
---|
GET /triggers/:app_id |
POST /triggers/:app_id |
PATCH /triggers/:app_id/:trigger_id |
GET /triggers/:app_id/:trigger_id |
DELETE /triggers/:app_id/:trigger_id |
Body Params |
---|
wallet_id required string |
name string maxLength 128 |
call_data required CreateWalletCall |
params_data TriggerParam |
params_data_input TriggerParamtab |
cURL
Node
Python
1 curl -X POST https://api.noramp.io/triggers/{app_id} \
2 -u API_KEY: \
3 -H 'Content-Type: application/json' \
4 -d '{"wallet_id":"wallet_id","call_data":{"near":{"contract_id":"contract_id","method_name":"method_name","method_type":"change","attached_deposit_amount":"0"}},"params_data":{"number":{}}}'
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
JSON Response:
{
"data": {
"id": "app_1hJuiOB3yJldYiDOdA4P6r",
"name": "name",
"call_data": {
"near": {
"contract_id": "contract.testnet",
"method_name": "mint_nft",
"method_type": "change",
"attached_deposit_amount": "0",
"gas_amount": "0",
"data": {}
}
},
"params_data": {
"number": {
"name": "name",
"optional": true,
"nullable": true
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"wallet": {
"id": "wal_1hJuiOB3yJldYiDOdA4P6r",
"name": "Testing Wallet",
"type": "near",
"managed": false,
"wallet_data": {
"near": {
"network_id": "mainnet",
"account_id": "account.near"
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"created_at": "2022-09-03T23:14:23.135Z",
"updated_at": "2022-09-03T23:14:23.135Z"
},
"created_at": "2022-09-02T14:39:01.159Z",
"updated_at": "2022-09-02T14:39:01.159Z"
}
}
--------------------------------------------------------------------------------------------
Response Object:
id string
name string
call_data WalletCall
params_data TriggerParam
app App
wallet Wallet
created_at string
updated_at string
1 const data = {
2 "wallet_id": "wallet_id",
3 "call_data": {
4 "near": {
5 "contract_id": "contract_id",
6 "method_name": "method_name",
7 "method_type": "change",
8 "attached_deposit_amount": "0"
9 }
10 },
11 "params_data": {
12 "number": {}
13 }
14 };
15
16 const response = await fetch('https://api.noramp.io/triggers/{app_id}', {
17 method: "POST",
18 headers: {
19 'content-type': 'application/json',
20 'authorization': 'Bearer {API_KEY}',
21 },
22 body: JSON.stringify(data)
23 })
24
25 console.log('response', await response.json());
-----------------------------------------------------------------------------------------------------
JSON Response:
{
"data": {
"id": "app_1hJuiOB3yJldYiDOdA4P6r",
"name": "name",
"call_data": {
"near": {
"contract_id": "contract.testnet",
"method_name": "mint_nft",
"method_type": "change",
"attached_deposit_amount": "0",
"gas_amount": "0",
"data": {}
}
},
"params_data": {
"number": {
"name": "name",
"optional": true,
"nullable": true
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"wallet": {
"id": "wal_1hJuiOB3yJldYiDOdA4P6r",
"name": "Testing Wallet",
"type": "near",
"managed": false,
"wallet_data": {
"near": {
"network_id": "mainnet",
"account_id": "account.near"
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"created_at": "2022-09-03T23:14:23.135Z",
"updated_at": "2022-09-03T23:14:23.135Z"
},
"created_at": "2022-09-02T14:39:01.159Z",
"updated_at": "2022-09-02T14:39:01.159Z"
}
}
--------------------------------------------------------------------------------------------
Response Object:
id string
name string
call_data WalletCall
params_data TriggerParam
app App
wallet Wallet
created_at string
updated_at string
1 import requests
2 import json
3
4 url = "https://api.noramp.io/triggers/{app_id}"
5
6 headers = {
7 'Content-Type': 'application/json',
8 'Authorization': 'Bearer {API_KEY}',
9 }
10
11 payload = json.dumps({
12 "wallet_id": "wallet_id",
13 "call_data": {
14 "near": {
15 "contract_id": "contract_id",
16 "method_name": "method_name",
17 "method_type": "change",
18 "attached_deposit_amount": "0"
19 }
20 },
21 "params_data": {
22 "number": {}
23 }
24 })
25
26 response = requests.request("POST", url, headers=headers, data=payload)
27
28 print(response.text)
------------------------------------------------------------------------------------------
JSON Response:
{
"data": {
"id": "app_1hJuiOB3yJldYiDOdA4P6r",
"name": "name",
"call_data": {
"near": {
"contract_id": "contract.testnet",
"method_name": "mint_nft",
"method_type": "change",
"attached_deposit_amount": "0",
"gas_amount": "0",
"data": {}
}
},
"params_data": {
"number": {
"name": "name",
"optional": true,
"nullable": true
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"wallet": {
"id": "wal_1hJuiOB3yJldYiDOdA4P6r",
"name": "Testing Wallet",
"type": "near",
"managed": false,
"wallet_data": {
"near": {
"network_id": "mainnet",
"account_id": "account.near"
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"created_at": "2022-09-03T23:14:23.135Z",
"updated_at": "2022-09-03T23:14:23.135Z"
},
"created_at": "2022-09-02T14:39:01.159Z",
"updated_at": "2022-09-02T14:39:01.159Z"
}
}
--------------------------------------------------------------------------------------------
Response Object:
id string
name string
call_data WalletCall
params_data TriggerParam
app App
wallet Wallet
created_at string
updated_at string
Body Params |
---|
wallet_id string |
name string maxLength 128 |
params_data TriggerParam |
call_data UpdateWalletCall |
PATCH /triggers/:app_id/:trigger_id
cURL
Node
Python
1 curl -X PATCH https://api.noramp.io/triggers/{app_id}/{trigger_id} \
2 -u API_KEY: \
3 -H 'Content-Type: application/json' \
4 -d '{"wallet_id":"{wallet_id}","call_data":{"near":{"contract_id":"contract_id","method_name":"method_name","method_type":"change","attached_deposit_amount":"0"}},"params_data":{"number":{}}}'
------------------------------------------------------------------------------------------------
JSON Response:
{
"data": {
"id": "app_1hJuiOB3yJldYiDOdA4P6r",
"name": "name",
"call_data": {
"near": {
"contract_id": "contract.testnet",
"method_name": "mint_nft",
"method_type": "change",
"attached_deposit_amount": "0",
"gas_amount": "0",
"data": {}
}
},
"params_data": {
"number": {
"name": "name",
"optional": true,
"nullable": true
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"wallet": {
"id": "wal_1hJuiOB3yJldYiDOdA4P6r",
"name": "Testing Wallet",
"type": "near",
"managed": false,
"wallet_data": {
"near": {
"network_id": "mainnet",
"account_id": "account.near"
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"created_at": "2022-09-03T23:14:23.135Z",
"updated_at": "2022-09-03T23:14:23.135Z"
},
"created_at": "2022-09-02T14:39:01.159Z",
"updated_at": "2022-09-02T14:39:01.159Z"
}
}
-----------------------------------------------------------------------------------------------
Response Object:
id string
name string
call_data WalletCall
params_data TriggerParam
params_data_input TriggerParam
app App
wallet Wallet
created_at string
updated_at string
1 const data = {
2 "wallet_id": "{wallet_id}",
3 "call_data": {
4 "near": {
5 "contract_id": "contract_id",
6 "method_name": "method_name",
7 "method_type": "change",
8 "attached_deposit_amount": "0"
9 }
10 },
11 "params_data": {
12 "number": {}
13 }
14 };
15
16 const response = await fetch('https://api.noramp.io/triggers/{app_id}/{trigger_id}', {
17 method: "PATCH",
18 headers: {
19 'content-type': 'application/json',
20 'authorization': 'Bearer {API_KEY}',
21 },
22 body: JSON.stringify(data)
23 })
24
25 console.log('response', await response.json());
------------------------------------------------------------------------------
JSON Response:
{
"data": {
"id": "app_1hJuiOB3yJldYiDOdA4P6r",
"name": "name",
"call_data": {
"near": {
"contract_id": "contract.testnet",
"method_name": "mint_nft",
"method_type": "change",
"attached_deposit_amount": "0",
"gas_amount": "0",
"data": {}
}
},
"params_data": {
"number": {
"name": "name",
"optional": true,
"nullable": true
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"wallet": {
"id": "wal_1hJuiOB3yJldYiDOdA4P6r",
"name": "Testing Wallet",
"type": "near",
"managed": false,
"wallet_data": {
"near": {
"network_id": "mainnet",
"account_id": "account.near"
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"created_at": "2022-09-03T23:14:23.135Z",
"updated_at": "2022-09-03T23:14:23.135Z"
},
"created_at": "2022-09-02T14:39:01.159Z",
"updated_at": "2022-09-02T14:39:01.159Z"
}
}
-----------------------------------------------------------------------------------------------
Response Object:
id string
name string
call_data WalletCall
params_data TriggerParam
params_data_input TriggerParam
app App
wallet Wallet
created_at string
updated_at string
1 import requests
2 import json
3
4 url = "https://api.noramp.io/triggers/{app_id}/{trigger_id}"
5
6 headers = {
7 'Content-Type': 'application/json',
8 'Authorization': 'Bearer {API_KEY}',
9 }
10
11 payload = json.dumps({
12 "wallet_id": "{wallet_id}",
13 "call_data": {
14 "near": {
15 "contract_id": "contract_id",
16 "method_name": "method_name",
17 "method_type": "change",
18 "attached_deposit_amount": "0"
19 }
20 },
21 "params_data": {
22 "number": {}
23 }
24 })
25
26 response = requests.request("PATCH", url, headers=headers, data=payload)
27
28 print(response.text)
--------------------------------------------------------------------------------------------------
JSON Response:
{
"data": {
"id": "app_1hJuiOB3yJldYiDOdA4P6r",
"name": "name",
"call_data": {
"near": {
"contract_id": "contract.testnet",
"method_name": "mint_nft",
"method_type": "change",
"attached_deposit_amount": "0",
"gas_amount": "0",
"data": {}
}
},
"params_data": {
"number": {
"name": "name",
"optional": true,
"nullable": true
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"wallet": {
"id": "wal_1hJuiOB3yJldYiDOdA4P6r",
"name": "Testing Wallet",
"type": "near",
"managed": false,
"wallet_data": {
"near": {
"network_id": "mainnet",
"account_id": "account.near"
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"created_at": "2022-09-03T23:14:23.135Z",
"updated_at": "2022-09-03T23:14:23.135Z"
},
"created_at": "2022-09-02T14:39:01.159Z",
"updated_at": "2022-09-02T14:39:01.159Z"
}
}
-----------------------------------------------------------------------------------------------
Response Object:
id string
name string
call_data WalletCall
params_data TriggerParam
params_data_input TriggerParam
app App
wallet Wallet
created_at string
updated_at string
GET /triggers/:app_id/:trigger_id
cURL
Node
Python
1 curl -X GET https://api.noramp.io/triggers/{app_id}/trigger_id \
2 -u API_KEY: \
3 -H 'Content-Type: application/json'
-------------------------------------------------------------------------
JSON Response:
{
"data": {
"id": "app_1hJuiOB3yJldYiDOdA4P6r",
"name": "name",
"call_data": {
"near": {
"contract_id": "contract.testnet",
"method_name": "mint_nft",
"method_type": "change",
"attached_deposit_amount": "0",
"gas_amount": "0",
"data": {}
}
},
"params_data": {
"number": {
"name": "name",
"optional": true,
"nullable": true
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"wallet": {
"id": "wal_1hJuiOB3yJldYiDOdA4P6r",
"name": "Testing Wallet",
"type": "near",
"managed": false,
"wallet_data": {
"near": {
"network_id": "mainnet",
"account_id": "account.near"
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"created_at": "2022-09-03T23:14:23.135Z",
"updated_at": "2022-09-03T23:14:23.135Z"
},
"created_at": "2022-09-02T14:39:01.159Z",
"updated_at": "2022-09-02T14:39:01.159Z"
}
}
------------------------------------------------------------------------------------------------
Response Object:
id string
name string
call_data WalletCall
params_data TriggerParam
params_data_input TriggerParam
app App
wallet Wallet
created_at string
updated_at string
1 const data = {
2 "wallet_id": "{wallet_id}",
3 "call_data": {
4 "near": {
5 "contract_id": "contract_id",
6 "method_name": "method_name",
7 "method_type": "change",
8 "attached_deposit_amount": "0"
9 }
10 },
11 "params_data": {
12 "number": {}
13 }
14 };
15
16 const response = await fetch('https://api.noramp.io/triggers/{app_id}/{trigger_id}', {
17 method: "PATCH",
18 headers: {
19 'content-type': 'application/json',
20 'authorization': 'Bearer {API_KEY}',
21 },
22 body: JSON.stringify(data)
23 })
24
25 console.log('response', await response.json());
------------------------------------------------------------------------------
JSON Response:
{
"data": {
"id": "app_1hJuiOB3yJldYiDOdA4P6r",
"name": "name",
"call_data": {
"near": {
"contract_id": "contract.testnet",
"method_name": "mint_nft",
"method_type": "change",
"attached_deposit_amount": "0",
"gas_amount": "0",
"data": {}
}
},
"params_data": {
"number": {
"name": "name",
"optional": true,
"nullable": true
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"wallet": {
"id": "wal_1hJuiOB3yJldYiDOdA4P6r",
"name": "Testing Wallet",
"type": "near",
"managed": false,
"wallet_data": {
"near": {
"network_id": "mainnet",
"account_id": "account.near"
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"created_at": "2022-09-03T23:14:23.135Z",
"updated_at": "2022-09-03T23:14:23.135Z"
},
"created_at": "2022-09-02T14:39:01.159Z",
"updated_at": "2022-09-02T14:39:01.159Z"
}
}
------------------------------------------------------------------------------------------------------------------------------------------------------
Response Object:
id string
name string
call_data WalletCall
params_data TriggerParam
params_data_input TriggerParam
app App
wallet Wallet
created_at string
updated_at string
1 import requests
2 import json
3
4 url = "https://api.noramp.io/triggers/{app_id}/{trigger_id}"
5
6 headers = {
7 'Content-Type': 'application/json',
8 'Authorization': 'Bearer {API_KEY}',
9 }
10
11 payload = json.dumps({
12 "wallet_id": "{wallet_id}",
13 "call_data": {
14 "near": {
15 "contract_id": "contract_id",
16 "method_name": "method_name",
17 "method_type": "change",
18 "attached_deposit_amount": "0"
19 }
20 },
21 "params_data": {
22 "number": {}
23 }
24 })
25
26 response = requests.request("PATCH", url, headers=headers, data=payload)
27
28 print(response.text)
-------------------------------------------------------------------------------------------
JSON Response:
{
"data": {
"id": "app_1hJuiOB3yJldYiDOdA4P6r",
"name": "name",
"call_data": {
"near": {
"contract_id": "contract.testnet",
"method_name": "mint_nft",
"method_type": "change",
"attached_deposit_amount": "0",
"gas_amount": "0",
"data": {}
}
},
"params_data": {
"number": {
"name": "name",
"optional": true,
"nullable": true
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc",
"app_fee": 0
},
"wallet": {
"id": "wal_1hJuiOB3yJldYiDOdA4P6r",
"name": "Testing Wallet",
"type": "near",
"managed": false,
"wallet_data": {
"near": {
"network_id": "mainnet",
"account_id": "account.near"
}
},
"app": {
"id": "app_6Up9GoHjp9tiObHtWW9b8s",
"name": "App Name",
"type": "individual",
"status": "active",
"use_explorer": true,
"created_at": "2022-08-03T17:13:36.275Z",
"updated_at": "2022-08-27T20:06:22.000Z",
"kyc_return_url": "https://myapp.com/settings/kyc"