In Primas, content interactions(like, comment, share) can only happen in groups. And interactions in a given group are only visible to this group. When interacting with content, the corresponding group id must be provided.
[GET] /shares/{share_id}
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | y | Account id. Account related status will be returned. |
data
is the metadata of a share:
Name | Type | Optional | Description |
---|---|---|---|
id | string | n | Share id. |
src_id | string | n | Content id. |
dest_id | string | n | Group id. |
creator | object | n | Creator. |
created | integer | n | Share created time. Unix timestamp. |
updated | integer | n | Share updated time. Unix timestamp. |
extra | object | y | Extra metadata. |
signature | string | n | Metadata signature. |
dna | string | n | Latest share DNA. |
transaction_id | string | n | Latest transaction id. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Account id. Root account id in the case of Sub account posting. |
account_name | string | n | Account name. |
sub_account_id | string | y | Sub account id. Refer to Sub account for details. |
sub_account_name | string | y | Sub account name. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
share_id | string | y | Parent share id. |
likes_total | integer | n | Total likes number. |
comments_total | integer | n | Total comments number. |
shares_total | integer | n | Total shares number. |
pst_total | big integer | n | Total PST earned. |
pst_updated | integer | n | Last PST updated time. Unix timestamp. |
is_liked | bool | y | Whether current account liked this share. |
content | object | n | Share related content. |
report | object | y | Report metadata. |
hp | integer | n | hp value. |
content
object contains the related content metadata.
report
object contains the related report metadata.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /shares/{share_id}/shares
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
account_id | string | y | Account id filter. |
data
is an array of shares:
Name | Type | Optional | Description |
---|---|---|---|
id | string | n | Share id. |
src_id | string | n | Content id. |
dest_id | string | n | Group id. |
creator | object | n | Creator. |
created | integer | n | Share created time. Unix timestamp. |
updated | integer | n | Share updated time. Unix timestamp. |
extra | object | y | Extra metadata. |
signature | string | n | Metadata signature. |
dna | string | n | Latest share DNA. |
transaction_id | string | n | Latest transaction id. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Account id. Root account id in the case of Sub account posting. |
account_name | string | n | Account name. |
sub_account_id | string | y | Sub account id. Refer to Sub account for details. |
sub_account_name | string | y | Sub account name. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
share_id | string | n | Parent share id. |
likes_total | integer | n | Total likes number. |
comments_total | integer | n | Total comments number. |
shares_total | integer | n | Total shares number. |
pst_total | big integer | n | Total PST earned. |
hp | integer | n | hp value. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /shares/{share_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 | Status filter. "pending", "approved" or "declined". |
data
is an array of reports:
Name | Type | Optional | Description |
---|---|---|---|
id | string | n | Report id. |
src_id | string | n | Account id. |
dest_id | string | n | Share id. |
creator | object | n | Creator. |
created | integer | n | Report created time. Unix timestamp. |
updated | integer | n | Report updated time. Unix timestamp. |
extra | object | n | Extra metadata. |
dna | string | n | Latest report DNA. |
signature | string | n | Metadata signature. |
transaction_id | string | n | Latest transaction id. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Account id. Root account id in the case of Sub account posting. |
account_name | string | n | Account name. |
sub_account_id | string | y | Sub account id. Refer to Sub account for details. |
sub_account_name | string | y | Sub account name. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
content | string | n | Content URI. In the case of IPFS, a link starts with "ipfs://" |
content_hash | string | n | Lowercase hex string of the Keccak256 hash of the raw content. |
report_type | string | n | Report type. |
report_status | string | n | "pending", "approved" or "declined". |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[POST] /shares/{share_id}/reports
Name | Type | Optional | Description |
---|---|---|---|
version | string | n | DTCP version. Fixed to "1.0". |
type | string | n | Fixed to "relation". |
tag | string | n | Fixed to "share_report". |
src_id | string | n | Account id. |
dest_id | string | n | Share id. |
creator | object | n | Creator. |
created | integer | n | Report created time. Unix timestamp. |
status | string | n | Fixed to "created". |
extra | object | n | Extra metadata. |
signature | string | n | Metadata signature. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Account id. Root account id in the case of Sub account posting. |
sub_account_id | string | y | Sub account id. Refer to Sub account for details. |
sub_account_name | string | y | Sub account name. For fast creation of new sub accounts. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
content | string | n | base64 encoded report content. |
content_hash | string | n | Lowercase hex string of the Keccak256 hash of the raw content. |
report_type | string | n | Report type. |
report_status | string | n | Fixed to "pending". |
Name | Type | Optional | Description |
---|---|---|---|
id | string | n | Report id. |
dna | string | n | Report DNA. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /shares/{share_id}/likes
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
account_id | string | y | Account id filter. |
data
is an array of likes:
Name | Type | Optional | Description |
---|---|---|---|
id | string | n | Like id. |
src_id | string | n | Account id. |
dest_id | string | n | Share id. |
hp | integer | n | hp value. |
creator | object | n | Creator. |
created | integer | n | Like created time. Unix timestamp. |
updated | integer | n | Like updated time. Unix timestamp. |
dna | string | n | Like DNA. |
signature | string | n | Metadata signature. |
transaction_id | string | n | Latest transaction id. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Account id. Root account id in the case of Sub account posting. |
account_name | string | n | Account name. |
sub_account_id | string | y | Sub account id. Refer to Sub account for details. |
sub_account_name | string | y | Sub account name. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[POST] /shares/{share_id}/likes
Name | Type | Optional | Description |
---|---|---|---|
version | string | n | DTCP version. Fixed to "1.0". |
type | string | n | Fixed to "relation". |
tag | string | n | Fixed to "share_like". |
src_id | string | n | Account id. |
dest_id | string | n | Share id. |
hp | integer | n | hp value. Greater than or equal to zero. |
creator | object | n | Creator. |
created | integer | n | Like created time. Unix timestamp. |
status | string | n | Fixed to "created". |
signature | string | n | Metadata signature. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Account id. Root account id in the case of Sub account posting. |
sub_account_id | string | y | Sub account id. Refer to Sub account for details. |
sub_account_name | string | y | Sub account name. For fast creation of new sub accounts. |
Name | Type | Optional | Description |
---|---|---|---|
id | string | n | Like id. |
dna | string | n | Like dna. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[DELETE] /shares/{share_id}/likes/{like_id}
Name | Type | Optional | Description |
---|---|---|---|
version | string | n | DTCP version. Fixed to "1.0". |
type | string | n | Fixed to "relation". |
tag | string | n | Fixed to "share_like". |
parent_dna | string | n | Latest DNA of the like. |
updated | integer | n | Like updated time. Unix timestamp. |
status | string | n | Fixed to "deleted". |
signature | string | n | Metadata signature. |
Name | Type | Optional | Description |
---|---|---|---|
dna | string | n | Like dna. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /shares/{share_id}/comments
Name | Type | Optional | Description |
---|---|---|---|
page | integer | y | Page number. Starts from 0. |
page_size | integer | y | Page size. Default to 20. |
account_id | string | y | Account id filter. |
data
is an array of top level comments:
Name | Type | Optional | Description |
---|---|---|---|
id | string | n | Comment id. |
src_id | string | n | Account id. |
dest_id | string | n | Share id. |
hp | integer | n | hp value. |
creator | object | n | Creator. |
created | integer | n | Comment created time. Unix timestamp. |
updated | integer | n | Comment created time. Unix timestamp. |
extra | object | n | Extra metadata. |
signature | string | n | Metadata signature. |
transaction_id | string | n | Latest transaction id. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Account id. Root account id in the case of Sub account posting. |
account_name | string | n | Account name. |
sub_account_id | string | y | Sub account id. Refer to Sub account for details. |
sub_account_name | string | y | Sub account name. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
content | string | n | Comment content. |
comments | array | n | Replying comments overview. |
comments
is an array of replying comments.
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[GET] /comments/{comment_id}/reply
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[POST] /shares/{share_id}/comments
The way comment content is processed is the same as post content API.
Name | Type | Optional | Description |
---|---|---|---|
version | string | n | DTCP version. Fixed to "1.0". |
type | string | n | Fixed to "relation". |
tag | string | n | Fixed to "share_comment". |
src_id | string | n | Account id. |
dest_id | string | n | Share id. |
hp | integer | n | hp value. Greater than or equal to zero. |
creator | object | n | Creator. |
created | integer | n | Comment created time. Unix timestamp. |
status | string | n | Fixed to "created". |
extra | object | n | Extra metadata. |
signature | string | n | Metadata signature. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Account id. Root account id in the case of Sub account posting. |
sub_account_id | string | y | Sub account id. Refer to Sub account for details. |
sub_account_name | string | y | Sub account name. For fast creation of new sub accounts. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
parent_comment_id | string | y | Parent comment id. |
content | string | n | Comment content. |
content_hash | string | n | Lowercase hex string of the Keccak256 hash of the raw content. |
Name | Type | Optional | Description |
---|---|---|---|
id | string | n | Comment id. |
dna | string | n | Comment dna. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[PUT] /shares/{share_id}/comments/{comment_id}
Name | Type | Optional | Description |
---|---|---|---|
version | string | n | DTCP version. Fixed to "1.0". |
type | string | n | Fixed to "relation". |
tag | string | n | Fixed to "share_comment". |
parent_dna | string | n | Latest comment DNA. |
creator | string | n | creator. |
updated | integer | n | Comment updated time. Unix timestamp. |
status | string | n | Fixed to "updated". |
extra | object | n | Extra metadata. |
signature | string | n | Metadata signature. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Account id. Root account id in the case of Sub account posting. |
sub_account_id | string | y | Sub account id. Refer to Sub account for details. |
extra
object:
Name | Type | Optional | Description |
---|---|---|---|
content | string | n | Comment content. |
content_hash | string | n | Lowercase hex string of the Keccak256 hash of the raw content. |
Name | Type | Optional | Description |
---|---|---|---|
dna | string | n | Comment dna. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}
[DELETE] /shares/{share_id}/comments/{comment_id}
This API can be used by both the comment creator or the group owner.
When delete comment by the group owner, the group owner's info must be
filled in the creator
field and group owner's account is used to generate signature.
Name | Type | Optional | Description |
---|---|---|---|
version | string | n | DTCP version. Fixed to "1.0". |
type | string | n | Fixed to "relation". |
tag | string | n | Fixed to "share_comment". |
parent_dna | string | n | Latest comment DNA. |
status | string | n | Fixed to "deleted". |
updated | integer | n | Comment updated time. Unix timestamp. |
creator | object | y | Creator. |
signature | string | n | Metadata signature. |
creator
object:
Name | Type | Optional | Description |
---|---|---|---|
account_id | string | n | Account id. Root account id in the case of Sub account posting. |
sub_account_id | string | y | Sub account id. Refer to Sub account for details. |
Name | Type | Optional | Description |
---|---|---|---|
dna | string | n | Comment dna. |
$ curl -x https://rigel-a.primas.network/v3/content -d '{"type":"article","content":"...","signature":"..."}'
{"result_code":0,"data":{"dna":"", ...}}