[GET] /accounts/{account_id}/metadata
[GET] /accounts/{account_id}/sub/{sub_account_id}/metadata
Name | Type | Optional | Description |
---|---|---|---|
id | string | n | Account id. |
address | string | n | Account address. |
title | string | n | Account name. |
abstract | string | y | Description. |
avatar | string | y | An image id used for avatar. |
creator | object | y | Creator of the sub account. |
created | integer | n | Account creation time. Unix timestamp. |
updated | integer | n | Account last updating time. Unix timestamp. |
extra | object | y | Extra metadata. |
signature | string | n | Metadata signature. |
dna | string | n | DNA of the account. |
hp | integer | n | available hp value. |
total_hp | integer | n | total hp value. |
credits | integer | n | Current credits. |
transaction_id | string | n | Latest transaction id. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Root account id. |
account_name | string | n | Root account name. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
hash | string | y | In the case of proof of existence of secret data. The hash can be filled in this field. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[POST] /accounts
Name | Type | Optional | Description |
---|---|---|---|
version | string | n | DTCP version. Fixed to "1.0". |
type | string | n | Fixed to "object". |
tag | string | n | Fixed to "account". |
name | string | n | Name. |
abstract | string | y | Description. |
avatar | string | y | An image id used for avatar. |
creator | object | y | Creator. Required when creating sub account. |
created | integer | n | Account creation time. Unix timestamp. |
extra | object | y | Extra metadata. |
status | string | n | Fixed to "created". |
address | string | n | Ethereum address, start with "0x" |
signature | string | n | Metadata signature. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Root account id. |
sub_account_id | string | n | Sub account id. This id is provided by the third-party application. Usually the id in the application system is used directly. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
hash | string | y | In the case of proof of existence of secret data. The hash can be filled in this field. |
Name | Type | Optional | Description |
---|---|---|---|
id | string | y | The id of the account. No id is returned for sub accounts. |
dna | string | n | The DNA of the account. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[PUT] /accounts/{account_id}
For updating, only the changed metadata need to be provided.
Name | Type | Optional | Description |
---|---|---|---|
version | string | n | DTCP version. Fixed to "1.0". |
type | string | n | Fixed to "object". |
tag | string | n | Fixed to "account". |
parent_dna | string | n | The latest DNA of the account. |
status | string | n | Fixed to "updated". |
updated | integer | n | Updating time. Unix timestamp. |
name | string | y | Name. |
abstract | string | y | Description. |
avatar | string | y | An image DNA used for avatar. |
creator | object | y | Creator. Required when updating sub account. |
extra | object | y | Extra metadata. |
address | string | n | Ethereum address, start with "0x" |
signature | string | n | Metadata signature. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Root account id. |
sub_account_id | string | n | Sub account id. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
hash | string | n | In the case of proof of existence of secret data. The hash can be filled in this field. |
Name | Type | Optional | Description |
---|---|---|---|
dna | string | n | Updated DNA of the (sub) account. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/credits
[GET] /accounts/{account_id}/sub/{sub_account_id}/credits
[GET] /accounts/{account_id}/content
[GET] /accounts/{account_id}/sub/{sub_account_id}/content
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
data
is an array of content.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/groups
[GET] /accounts/{account_id}/sub/{sub_account_id}/groups
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
data
is an array of group.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/shares
[GET] /accounts/{account_id}/sub/{sub_account_id}/shares
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
application_status | string | y | Status filter. "pending", "approved" or "declined". |
data
is an array of group shares.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/groups/{group_id}/shares
[GET] /accounts/{account_id}/sub/{sub_account_id}/groups/{group_id}/shares
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
application_status | string | y | Status filter. "pending", "approved" or "declined". |
data
is an array of group shares.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/likes
[GET] /accounts/{account_id}/sub/{sub_account_id}/likes
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
data
is an array of likes.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/comments
[GET] /accounts/{account_id}/sub/{sub_account_id}/comments
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
data
is an array of comments.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/applications/groups
[GET] /accounts/{account_id}/sub/{sub_account_id}/applications/groups
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
application_status | string | y | "pending", "approved" or "declined". |
data
is an array of group member.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/applications/shares
[GET] /accounts/{account_id}/sub/{sub_account_id}/applications/shares
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
application_status | string | y | "pending", "approved" or "declined". |
data
is an array of share.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/reports
[GET] /accounts/{account_id}/sub/{sub_account_id}/reports
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
report_status | string | y | "pending", "approved" or "declined". |
data
is an array of report.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/notifications
[GET] /accounts/{account_id}/sub/{sub_account_id}/notifications
The notification read status cannot be recorded in a decentralized system. To implement read status
in clients, client should record a timestamp about the last time notifications are fetched. When calling
API the timestamp should be passed as start_time
to retrieve only the notifications after and mark
them as unread notifications.
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
start_time | integer | y | List from this time. Unix timestamp. |
data
is an array of notifications:
Name | Type | Optional | Description |
---|---|---|---|
type | string | n | Notification type. |
created | integer | n | Notification creation time. |
object_id | string | y | Notification related object id. |
extra | object | y | Extra metadata. |
Notification Types:
- Share
share_liked
- Share is likedshare_commented
- Share is commentedshare_shared
- Share is shared
- Report
report_processed
- Report is processed
- Group
member_application
- New group member applicationmember_application_processed
- Group member application processedshare_application
- New group share applicationshare_application_processed
- Group share application processed
- Incentives
incentives
- Incentives calculatedwithdrawal_processed
- Withdrawal processed
- Token
pre_lock_success
- Token pre-lock successpre_lock_unlocked
- Token pre-lock unlocked
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/avatar
[GET] /accounts/{account_id}/sub/{sub_account_id}/avatar
data
is content metadata.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/avatar/raw
[GET] /accounts/{account_id}/sub/{sub_account_id}/avatar/raw
Primas Node can build local cache of raw image for accessing speed. Or redirect the request to image URI for raw content directly.
Response is raw image data.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /main/accounts/{address}/metadata
Get main account metadata by address.
Name | Type | Optional | Description |
---|---|---|---|
id | string | n | Account id. |
address | string | n | Account address. |
title | string | n | Account name. |
abstract | string | y | Description. |
avatar | string | y | An image id used for avatar. |
creator | object | y | Creator of the sub account. |
created | integer | n | Account creation time. Unix timestamp. |
updated | integer | n | Account last updating time. Unix timestamp. |
extra | object | y | Extra metadata. |
signature | string | n | Metadata signature. |
dna | string | n | DNA of the account. |
hp | integer | n | available hp value. |
total_hp | integer | n | total hp value. |
credits | integer | n | Current credits. |
transaction_id | string | n | Latest transaction id. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Root account id. |
account_name | string | n | Root account name. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
hash | string | y | In the case of proof of existence of secret data. The hash can be filled in this field. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /accounts/{account_id}/joined/groups
[GET] /accounts/{account_id}/sub/{sub_account_id}/joined/groups
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
data
is an array of group.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}