User Data API

Overview

Using User Data can bring a whole new layer to your Smart Triggers and it can make writing your ParsiQL code less bulky. Instead of using the web interface to modify it, our API gives you a way to dynamically modify User Data entries, e.g. for adding new monitoring addresses programatically.

Obtaining necessary information

Obtaining an API key

Navigate to PARSIQ Portal, in the left-hand column press β€œβ€¦β€ button next to the project of interest and press β€œCopy API key”.

Retrieving User Data

USERDATA_TABLE_ID can be found in the interface

Supported commands and examples

Our API supports the following commands
Command
Description
GET
to read user data
POST
to insert user data
PATCH
to update (and insert) user data
DELETE
to delete user data
PUT
to completely replace user data

How to use them

For example, we have a user data table with this info

GET command

To retrive your User Data, use this command
1
curl --location --request GET 'https://api.parsiq.net/v1/data/USERDATA-TABLE-ID'
2
--header 'Authorization: Bearer YOUR-API-KEY'
Copied!

POST command

To add new rows to your User data table, use this command. In this example, two new rows will be added to our user data.
1
curl --location --request POST 'https://api.parsiq.net/v1/data/USERDATA-TABLE-ID'
2
--header 'Authorization: Bearer YOUR-API-KEY'
3
--header 'Content-Type: application/json'
4
--data-raw
5
'
6
[
7
{
8
"coin": "testcoin2",
9
"symbol": "test2",
10
"address": "0xde2d9bf936097395c5EFA0951820DaF49e0065F6"
11
},
12
{
13
"coin": "testcoin3",
14
"symbol": "test3",
15
"address": "0x85b3bA386648a0012EE0ff67E7B1701B3ceCf920"
16
}
17
]'
Copied!
Updated User Data Table with 2 new addresses

PATCH command

If you need to update the info in User Data, you can use the patch command. It can also be used to add new rows to your table. in this example we will update the first row and add a new one.
1
curl --location --request PATCH 'https://api.parsiq.net/v1/data/USERDATA-TABLE-ID'
2
--header 'Authorization: Bearer YOUR-API-KEY'
3
--header 'Content-Type: application/json'
4
--data-raw
5
'
6
[
7
{
8
"coin": "testcoinPATCH",
9
"symbol": "PATCH",
10
"address": "0x26a601ac8a07e1c8b27bd2a5f05d6ec89fe7c100"
11
},
12
{
13
"coin": "NewCoin",
14
"symbol": "NEW",
15
"address": "0xf89d7b9c864f589bbF53a82105107622B35EaA40"
16
}
17
]'
Copied!
Patched User Data table

DELETE command

To delete an address row, we need to add an address you want to remove to API's URL. In this example we will remove the second address from our table
1
curl --location --request DELETE 'https://api.parsiq.net/v1/data/USERDATA-TABLE-ID/0x847b144a9e84a68dc0af9dafd3ca98847d7c1551'
2
--header 'Authorization: Bearer YOUR-API-KEY'
Copied!
Updated table after DELETE command

PUT command

Use this to entirely replace rows of your User Data Table. Technically you can update, delete and post new rows with this command if you would put an entire updated list of your desired addresses. But in this example, we will put 2 new addresses instead of 4 old ones.
1
curl --location --request PUT 'https://api.parsiq.net/v1/data/USERDATA-TABLE-ID/'
2
--header 'Authorization: Bearer YOUR-API-KEY'
3
--header 'Content-Type: application/json'
4
--data-raw
5
'
6
[
7
{
8
"coin": "PutCoin1",
9
"symbol": "PUT1",
10
"address": "0xB14b407607A5Dfce792AdD5F27d9e470d78dAA3c"
11
},
12
{
13
"coin": "PutCoin2",
14
"symbol": "PUT2",
15
"address": "0xc2a483f696d46886b3bd82947e40c442153848ea"
16
}
17
]'
Copied!
Our table with the new address we put in
Last modified 1mo ago