API - HiveSociety/Docs GitHub Wiki

API of HTTP requests between Client & Server

 
// general request
// https://ihive.app/blockchain?data={"param1":"some text data", "param2":"42231323"}&action=comment_add
data - json encoded string parameter with any data object
action - action to execute : qa_list, user_get ...
 

USER (system)

// public user data

user_object = {
fname:"some app", //first name
lname:"some app", //last name
id:"userid", 
interests:["interest_id1", "interest_id1"], 
registerd_date: "timestamp",
apps:["app1", "app2"], 
contacts:["user1", "user2"], 
karma:121, 
email:"[email protected]", 
badges:["badge1"], 
}
  • user_register | (id fname lname email) >>> true|false
  • user_get | (id) >>> user_object
  • user_addcontact | (contact_id) >>> true|false
  • user_update | (id fname lname email) >>> true|false
  • user_installapp | (appid installoption) >>> true|false // install|uninstall app
  • user_login | (id) >>> true|false
  • user_logout | () >>> true|false

EVENTS (system)

event_object = {
text:"event description", 
id:"eventid", 
userid:"userid", // whose event is this, if userid=system then it is system event and public to all
eventtype:"eventtype", 
tiem:"timestamp", 
data: "some editional data"
}
  • events_get (offset size) | (name_en description) >>> [event_object1, event_object2 ]

INTEREST (system)

  • interests_get | () >>> [{name_en, id}, ...] // returns all interests in hive

APPS (system) - all user apps on platform

app_object = {
name_en:"some app", 
id:"appid", 
description:"app description", 
users:["user1", "user2"]
}
  • app_add (internal call) | (name_en description) >>> true|false
  • app_get | (id) >>> app_object
  • app_getall | () >>> [app_object1, app_object2 ...]
  • app_edit (internal call) | (name_en description id) >>> true|false

COMMENTS (app level)

comment_object = {
object_type:"type_of_object", // can be question|post|voting etc
object_id:"someid", // id_of_object_where_comment_atached_to
text:"comment text", 
creator:"comment_creatoruser_id", 
time:"timestamp", 
id:"comment_object_id", 
voters:["user1", "user2"]
}
  • comment_add | (text object_id object_type creator) >>> comment_object_id // add one comment
  • comment_edit | (comment_object_id text) >>> true|false // edit one comment
  • comment_get | (object_id object_type ) >>> [comment_object1 , comment_object2 ...] //get all comments to an object
  • comment_upvote | (comment_object_id) >>> true|false

QA (app) - question & answers app

qa_object = {
title:"what is ... ?", 
text:"question details", 
interest:"programming", 
creator:"user0", 
upvoters:["user1", "user2"], 
time:"timestamp", comments:[{},{}], id}
  • qa_create | (text interest title) >>> qaid|false
  • qa_get | (qaid) >>> qa_object
  • qa_edit | (qaid text interest title ) >>> true|false
  • qa_upvote | (qaid) >>> true|false
  • qa_list | (offset size interest) >>> [qa_object, qa_object]

VOTING (app)

voting_object = {
creator:"creator_id", // author 
id:"someid", // unique id of voting object
title:"text of voting", 
options:[{title:"option 1 title to vote for"}, voters:["user_id1", "user_id2" ]}], 
time:"timestamp", 
upvoters:["user1", "user2"] //upvoters for all voting object 
}

voting_options = {title:"option 1 title to vote for"}, voters:["user_id1", "user_id2" ]} // option to vote for

  • voting_create | (title options creator_id) >>> voting_object_id|false // create vote object
  • voting_edit | (voting_object title options ) >>> true|false // edit vote object
  • voting_get | (voting_object ) >>> voting_object
  • voting_upvote | (voting_object ) >>> true|false
  • voting_list | (offset size) >>> [voting_object1 , voting_object2 ... ]

PEOPLE (app)

  • people_search (not implemented) | (interest search_string) >>> [user_object1, user_object2... ]
  • people_list | (from size) >>> [user_object1, user_object2... ]

HOWTO(app)


WALLET (system)


TRIBES (app)


NEWS (app)