Draft about object - Waiviogit/waivio GitHub Wiki
- What is an object?
- How does it work?
- Object types and general list of fields
- General payload for adding an update-field
- "field" detailed information
An object on Waivio is a user-created entity such as a restaurant, hashtag, business, product, etc., which is given a unique URL (permlink) on the Hive blockchain. It serves as a specific reference point that can be linked to posts and contributes to the structured accumulation of knowledge within the Waivio and Hive ecosystem.
Simplified concept: The object type is a post, and each first-level comment under it is an object. Second-level comments and beyond are its updates. Users add updates through our bots and vote for them; updates with the most votes win.
Object types that you might be interested in include: product, book, business, restaurant, list, and page.
Each of these types has a list of fields, which represents the information that can be added to each object.
List of fields that the user can add for each object type:
Object type | Fields |
---|---|
product | status, avatar, authority, name, title, background, parent, tagCategory, categoryItem, galleryAlbum, galleryItem, sortCustom, rating, price, description, website, productId, dimensions, productWeight, groupId, options, departments, merchant, manufacturer, brand, features, pin, remove, menuItem, related, addOn, similar, delegation |
business | status, avatar, authority, name, title, background, parent, tagCategory, categoryItem, galleryAlbum, galleryItem, sortCustom, rating, price, description, workTime, address, map, website, phone, email, link, companyId, pin, remove, menuItem, walletAddress, delegation |
restaurant | status, avatar, authority, name, title, background, parent, tagCategory, categoryItem, galleryAlbum, galleryItem, sortCustom, rating, price, description, workTime, address, map, website, phone, email, link, companyId, pin, remove, menuItem, walletAddress, delegation |
list | status, avatar, authority, name, title, background, parent, tagCategory, categoryItem, galleryAlbum, galleryItem, website, description, listItem, sortCustom, pin, remove, delegation |
page | status, avatar, authority, name, title, background, parent, tagCategory, categoryItem, galleryAlbum, galleryItem, pageContent, website, description, pin, remove, delegation |
(Details for each field are provided below.)
Request – /objects-bot/append-object
- Field or update (noun), or field-update, the same thing with the same meaning, can be called interchangeably.
Here Simplified Document with Requests Only
{
"author": "string",
"permlink": "string",
"parentAuthor": "string",
"parentPermlink": "string",
"body": "string",
"title": "string",
"field": {
"name": "string",
"body": "string",
"locale": "string"
}
}
Field Name | Example Value (in JSON) | Description |
---|---|---|
author |
"author": "wiv01" |
Comment author, user who adds the update field. Field type: string. |
parentAuthor |
"parentAuthor": "fgh87" |
The name of the bot that created the object (author of the comment that created the object) to which the update will be added. Field type: string. |
parentPermlink |
"parentPermlink": "lqd-test-rest-id04071600" |
The unique permalink of the object where users want to add related updates. It's the specific object permlink to which the update field will be appended (from author_permlink field for object). Example: A user wants to add an updated-field to "test1" object (https://example.com/test1). In this case, "parentPermlink" would be "test1". Field type: string. |
body |
"body": "@wiv01 added parent (English):\n vuf-test-rest-v6" |
Custom text containing update information. Template: @{username} added {field} ({locale}): {details}. Example: @wiv01 added description (English):/n test Field type: string. |
title |
"title": "" |
This should be empty because comments do not require a title. Field type: string. |
permlink |
"permlink": "wiv01-5bu8lnlxelw" |
Random string following the rules for generating permalinks (without special characters, etc.). Field type: string. |
field |
"field": { "name": "parent", "body": "vuf-test-rest-v6", "locale": "en-US" }
|
Information about specific update-field. Field type: object: name - name of the field. Field type: string; body - value of the field. Field type: string; locale - locale of the field using locale identifier (en-US etc.). Field type: string. |
{
"author": "wiv01",
"parentAuthor": "fgh87",
"parentPermlink": "lqd-test-rest-id04071600",
"body": "@wiv01 added parent (English):\n vuf-test-rest-v6",
"title": "",
"field": {
"name": "parent",
"body": "vuf-test-rest-v6",
"locale": "en-US"
},
"permlink": "wiv01-5bu8lnlxelw",
}
Now, when you know main details about how to make request to add update-field, know you can read about each specif field in details.
Field for adding an address.
body
- includes information from all fields: address, street, city, state, postalCode, country.
// example
{
"name": "address",
"body": "{\"address\":\"testFullAddress\",\"street\":\"testStreet\",\"city\":\"testCity\",\"state\":\"testState\",\"postalCode\":\"testPostalCode1111\",\"country\":\"testCountry\"}",
"locale": "en-US"
}
The add-on field is for including additional objects that users might find interesting, providing a way to connect one object with another.
body
- object permlink of the object that will be added.
// example
{
"name": "addOn",
"body": "hfa-test-product-14031521",
"locale": "en-US"
}
The authority field is claims rights for the object from user. Has two options: administrative, ownership.
The meaning of this function is that the site owner in the Administrators section can then add users whom he trusts and they automatically have admin rights to the objects they claim. For example, a manufacturer posted descriptions of its products on the Hive blockchain and indicated itself as the Ownership authority for these objects. And if the site owner adds this user as a trusted authority, then all his products will automatically appear on the site. And when a trusted authority adds, removes or edits objects, these changes are immediately displayed on the site.
-
Administrative means that the fields can be changed by other users, but if the authority account voted Approve or Reject, then this is the final vote.
-
Ownership means that only fields that are Approved will be taken into account when composing the object, and all that are not directly approved will be skipped.
body
- has two options: administrative, ownership.
// example
{
"name": "authority",
"body": "ownership",
"locale": "en-US"
}
The field to add the avatar for the object.
body
- the image link.
id
- ID of album.
// example
{
"name": "avatar",
"body": "https://waivio.nyc3.digitaloceanspaces.com/666b0f5e8112c9786543b51f87297537657ab8425e74ff2df2736e9216e99d77",
"locale": "en-US",
"id": "2v5a7qlew43"
}
The field to add the background image for the object.
body
- the image link.
// example
{
"name": "background",
"body": "https://waivio.nyc3.digitaloceanspaces.com/23dec65bb8f56b2979a5c50be6d79cbe59ce39f3466544e0b5af46f72f282568",
"locale": "en-US"
}
The field to add the brand name or object.
body
- stringified object, which contains the following fields: "name" (an optional field) and "authorPermlink" (the object permalink that would be added as the brand, with the name taken from the object itself). Both fields type: string.
const brandBody = JSON.stringify({
"name" : string
"authorPermlink" : string // required
})
// example
{
"name": "brand",
"body": "{\"name\":\"brand name\",\"authorPermlink\":\"fcs-test-brand-02021105\"}",
"locale": "en-US"
}
This field is used to add a tag. The tag requires a Tag category (tagCategory) where it will be added, allowing us to categorize tags. Tags are objects with a hashtag type.
body
- the permalink of the "hashtag" object.
id
- tag category ID.
tagCategory
- tag category name.
// example
{
"name": "categoryItem",
"body": "testing",
"locale": "en-US",
"id": "62cf6c75-5ab7-4a64-9b0a-174b4122fa5c",
"tagCategory": "Test"
}
The field to add company ID.
body
- stringified object, which contains the following fields: "companyId" (the ID value) and "companyIdType" (the type value). Both fields type: string.
const companyIdBody = JSON.stringify({
companyId: "string", // required,
companyIdType: "string",
})
// example
{
"name": "companyId",
"body": "{\"companyIdType\":\"TEST\",\"companyId\":\"11111\"}",
"locale": "en-US"
}
The field to assign a user to delegate exclusive administrative rights limited to the site(s) where the user holds ownership or administrator status for a specific object.
body
- a username.
// example
{
"name": "delegation",
"body": "new-way",
"locale": "en-US"
}
The field to add description.
body
- the description value.
// example
{
"name": "description",
"body": "test description...",
"locale": "en-US"
}
This field is used to add dimensions.
body
- a stringified object containing the following fields:
- "length" - required, minimum value of 0. Field type: number.
- "width" - required, minimum value of 0. Field type: number.
- "depth" - required, minimum value of 0. Field type: number.
- "unit" - required, enumeration: km, m, cm, mm, μm, mi, yd, ft, in, nmi. Field type: string.
const dimensionsBody = JSON.stringify({
length: "number", // required, min 0
width: "number", // required, min 0
depth: "number", // required, min 0
unit: "string", // required, enum: km, m, cm, mm, μm, mi, yd, ft, in, nmi,
})
// example
{
"name": "dimensions",
"body": "{\"length\":\"10\",\"width\":\"5\",\"depth\":\"2\",\"unit\":\"in\"}",
"locale": "en-US"
}
This field is used to specify the departments to which the object belongs.
body
- a depatment name. If the department does not exist, it will be created.
// example
{
"name": "departments",
"body": "test product",
"locale": "en-US"
}
This field is used to add the email.
body
- the email value.
// example
{
"name": "email",
"body": "[email protected]",
"locale": "en-US"
}
This field is used to add features information.
body
- a stringified object containing the following fields: "key" and "value".
const featuresBody = JSON.stringify({
key: "string",
value: "string",
})
// example
{
"name": "features",
"body": "{\"key\":\"TestName\",\"value\":\"TestValue\"}",
"locale": "en-US"
}
This field is used to add album for images.
body
- an album name.
id
- albume id. (?) random string
// example
{
"name": "galleryAlbum",
"body": "test1",
"locale": "en-US",
"id": "x045ap7o5to"
}
This field is used to add an image. The images are stored within an album.
body
- an image URL.
id
- ID of album.
// example
{
"name": "galleryItem",
"body": "https://waivio.nyc3.digitaloceanspaces.com/38a46fc471e30c2f12e5a6aa51ed8f32837837cc0cdbb1a653b699683759a138",
"locale": "en-US",
"id": "33gpml4k4tr"
}
The field to add group ID. The purpose of this field is to combine descriptions of different options of the same product into one presentation. For example, a product may have a different color, size, configuration, format, etc. In order to best describe each option, each of them can be written as an independent object with its own set of descriptions (title, description, avatar, price, gallery) and options (color, size, package, set, format, etc.). Each of these objects must reference the same Group ID. All objects with the same Group ID are combined into one universal view.
body
- full group ID.
// example
{
"name": "groupId",
"body": "test111",
"locale": "en-US"
}
This field, "listItem," exists exclusively for objects of type "list." It is utilized to add items to the list.
body
- permlink of the object that will be added to the list.
// example
{
"name": "listItem",
"body": "exh-test-list-27091703",
"locale": "en-US"
}
The field is used to add a map. Coordinates will include "latitude" and "longitude".
(?)
const mapBody = JSON.stringify({
latitude: number[],
longitude: number[],
})
// example
{
"name": "map",
"body": "{\"latitude\":\"53.435451\",\"longitude\":\"14.518846\"}",
"locale": "en-US"
}
The field to add the manufacturer name or object.
body
- a stringified object, which contains the following fields: "name" (an optional field) and "authorPermlink" (the object permalink that would be added as the manufacturer, with the name taken from the object itself). Both fields type: string.
const manufacturerBody = JSON.stringify({
name: "string",
authorPermlink: "string",
})
// example
{
"name": "manufacturer",
"body": "{\"name\":\"test name\",\"authorPermlink\":\"qpf-test-manufacturer-02021103\"}",
"locale": "en-US"
}
The field to add buttons. List, page, external link (old button), newsfeed, widget can be added as menu item.
body
- a stringified object containing the following fields, must have either "linkToObject" or "linkToWeb":
- "title" - the title of the menu item (required).
- "style"- the style of the menu item (required).
- "image" - the image of the menu item.
- "linkToObject" - the permlink of an existing object if applicable.
- "objectType" - the type of the linked object if 'linkToObject' is provided.
- "linkToWeb" - a valid URI for linking to a web page. All fields type: string.
const menuItemBody = JSON.stringify({
title: string, //required
style: string, //required
image: string,
linkToObject: string, // existing author_permlink
objectType: string, // if linkToObject
linkToWeb: string, // valid uri
})
// menuItemBody must have either linkToObject or linkToWeb
// example
{
"name": "menuItem",
"body": "{\"title\":\"test title\",\"style\":\"standard\",\"linkToObject\":\"mor-test-list-not-bad-advice\",\"objectType\":\"list\"}",
"locale": "en-US"
}
The field to add the merchant name or object.
body
- stringified object, which contains the following fields:
- "name" - custom name, an optional field;
- "authorPermlink" - the object permlink that would be added as the merchant, with the name taken from the object itself. Both fields type: string.
const merchantBody = JSON.stringify({
name: "string",
authorPermlink: "string",
})
// example
{
"name": "merchant",
"body": "{\"name\":\"test name\",\"authorPermlink\":\"btw-test-merchant-02021106\"}",
"locale": "en-US"
}
The field to add the name.
body
- the name.
// example
{
"name": "name",
"body": "test name",
"locale": "en-US"
}
The field is used to add an option. The Options field works in conjunction with the Group ID field, consolidating all potential options for a given product or service into a single view.
body
- a stringified object containing the following fields:
- "category" - a name indicating the category of the option (required). Field type: string.
- "value" - a value representing the value of the option (required). Field type: string.
- "position" - a number indicating the position of the option. Field type: number.
- "image" - an image URL. Field type: string.
const optionsBody = JSON.stringify({
category: "string", // required
value: "string", // required
position: "number",
image: "string",
})
// example
{
"name": "options",
"body": "{\"category\":\"Test\",\"value\":\"test1\",\"position\":\"1\",\"image\":\"https://waivio.nyc3.digitaloceanspaces.com/d5cc755bff705674ef7eecd05d5b3d833d0f2672985d8ba6c9dc369b2cbbb4fb\"}",
"locale": "en-US"
}
The field is used to add page content, exists exclusively for objects of type "page".
body
- a content text.
// example
{
"name": "pageContent",
"body": "test 111\n",
"locale": "en-US"
}
This field is used to add parent object. One of the way to make connection between objects.
body
- permlink of the object that will be added as parent.
// example
{
"name": "parent",
"body": "ksg-test-product-21031525",
"locale": "en-US"
}
This field is used to add phone number.
body
- phone name (can be empty if a phone name is not needed).
number
- value of phone number.
// example
{
"name": "phone",
"body": "Name1",
"locale": "en-US",
"number": "11111111"
}
This field is used to pin post at the top of the object reviews feed.
body
- a string with the structure "author/postPermlink".
// example
{
"name": "pin",
"body": "wiv01/embracing-the-journey-overcoming-challenges-in-writing-your-first-book",
"locale": "en-US"
}
This field is used to add price information.
body
- price information.
{
"name": "price",
"body": "10-20",
"locale": "en-US"
}
The field to add product ID.
body
- stringified object, which contains the following fields:
- "productId" - a value of the product ID (required).
- "productIdType" - a value of the product ID (required).
- "productIdImage" - an image URL (optional). All fields type: string.
const productIdBody = JSON.stringify({
productId: "string", // required,
productIdType: "string", // required,
productIdImage: "string", // new Url() check
})
// example
{
"name": "productId",
"body": "{\"productIdType\":\"test\",\"productId\":\"123456\",\"productIdImage\":\"https://waivio.nyc3.digitaloceanspaces.com/d5cc755bff705674ef7eecd05d5b3d833d0f2672985d8ba6c9dc369b2cbbb4fb\"}",
"locale": "en-US"
}
The field to add weight information.
body
- stringified object, which contains the following fields:
- "value" - the weight amount, minimum value of 0. Field type: number.
- "unit" - the unit of measurement, enumeration: t, kg, gm , mg, mcg, st, lb, oz. Field type: string.
const weightBody = JSON.stringify({
value: "number", // required, min 0
unit: "string", // required, enum: t, kg, gm , mg, mcg, st, lb, oz
})
// example
{
"name": "productWeight",
"body": "{\"value\":\"10\",\"unit\":\"kg\"}",
"locale": "en-US"
}
The field to add rating category.
body
- the rating category name.
// example
{
"name": "rating",
"body": "Good",
"locale": "en-US"
}
The field is for including additional objects that are related to the object.
body
- object permlink of the object that will be added as related.
// example
{
"name": "related",
"body": "jhf-test-product-23051329",
"locale": "en-US"
}
This field is used to remove (hide) the post from the object reviews feed.
body
- a string with the structure "author/postPermlink".
// example
{
"name": "remove",
"body": "wiv01/how-to-start-writing-a-book-a-journey-from-idea-to-manuscript",
"locale": "en-US"
}
The field is for including additional objects that are similar to the object.
body
- object permlink of the object that will be added as similar.
// example
{
"name": "similar",
"body": "tkt-test-product-12031444",
"locale": "en-US"
}
The "sortCustom" field has two functions: one specific to the "list" object type and another for other object types.
**For "list" object type ** This field is used to add sorting for items that were added to a list. Therefore, this field exists only for the "list" object type. Items can be excluded (hidden) from the list.
(?)
body
- stringified object, which contains the following fields:
- "exclude" - a list of permalinks for excluded objects. Field type: array.
- "include" - a list of permalinks for included objects, arranged in the preferred sorting order. Field type: array.
// example
{
"name": "sortCustom",
"body": "{\"exclude\":[\"exh-test-list-27091703\"],\"include\":[\"bev-test-list-not-bad-advice-2\",\"viw-test-test-03061511\"]}",
"locale": "en-US"
}
For other object types The "sortCustom" field is used to sort menu items. For objects that have a menuItems field, this field allows sorting of the menu items in the preferred order. Exclusion of items is not supported; only sorting is permitted.
body
- stringified object, which contains the following fields:
- "exclude" - empty array. Field type: array.
- "include" - a list of permalinks, arranged in the preferred sorting order. Field type: array.
// example
{
"name": "sortCustom",
"body": "{\"include\":[\"waivio-jase-carmel-rez68eawifh\",\"wiv01-2vq0sk91yea\"],\"exclude\":[]}",
"locale": "en-US"
}
This field is used to add a status mark to the object.
Statuses:
- Unavailable (object could not be found anymore);
- Relisted (moved to another object, with a provided link);
- NSFW;
- Flagged.
body
- stringified object, which contains the following fields:
- "title" - one of the statuses (Unavailable, Relisted, NSFW, Flagged). Field type: string.
- "link" - object permlink of the other object. Only applicable for the Relisted status. Field type: string.
// example
{
"name": "status",
"body": "{\"title\":\"relisted\",\"link\":\"exh-test-list-27091703\"}",
"locale": "en-US"
}
This field is used to add a tag category for tags (categoryItem).
body
- tag category name.
// example
{
"name": "tagCategory",
"body": "Test",
"locale": "en-US",
"id": "bfb5e9e9-ed39-46b8-97ca-23764a3f23d8"
}
This field is used to add a title text.
body
- the title text.
// example
{
"name": "title",
"body": "test",
"locale": "en-US"
}
This field is used to add wallet address information.
body
- stringified object, which contains the following fields:
- "title" - custom text.
- "symbol" - currency (required). Options: Bitcoin (BTC), Litecoin (LTC), Ethereum (ETH), Lightning Bitcoin (LBTC), HIVE, HBD, WAIV.
- "address" - the wallet address value (required). All fields type: string.
const walletAddressBody = JSON.stringify({
"title" : string
"symbol" : string // required
"address" : string // required
})
// example
{
"name": "walletAddress",
"body": "{\"title\":\"support us\",\"symbol\":\"Bitcoin (BTC)\",\"address\":\"bc11111111\"}",
"locale": "en-US"
}
This field is used to add a website link.
body
- stringified object, which contains the following fields:
- "title" - custom link text.
- "link" - the URL. All fields type: string.
// example
{
"name": "website",
"body": "{\"title\":\"site\",\"link\":\"https://example.com\"}",
"locale": "en-US"
}
This field is used to add a working hours information.
body
- text about working hours.
// example
{
"name": "workTime",
"body": "working hours info",
"locale": "en-US"
}