CreateAccount

Address: https://api.varqa.ir/account/create/

Method: POST


Header Params: blank


Body Params as json: name, family, user, password, email, phone


Json Example: {"name": "Ali", "family": "Mohammadi", "user": "hosein", "password": "mypass", "email": "contact@alimohammadi.com", "phone": "+989121234567"}


Json Response: {"ok": true}



VerifyAccount

Address: https://api.varqa.ir/account/verify/

Method: POST


Header Params: blank


Body Params as json: user, password, token


Json Example: {"user": "hosein", "password": "mypass", "token": "received from email"}


Json Response: {"ok": true}



Login

Address: https://api.varqa.ir/login/

Method: POST


Header Params: varqauser(Your User), varqapass(Your Password)


Body Params: blank


Json Response: {"ok": true, "id": user_identity_number}



StartPrivateTalk

Address: https://api.varqa.ir/private/

Method: POST


Header Params: varqauser, varqapass


Body Params as json: contact


Json Example: {"contact": "user or phone of your contact"}


Json Response: {"ok": true, "results": {"group_id": group_identity}}



JoinInGroupChannel

Address: https://api.varqa.ir/group/enter/

Method: GET


Header Params: varqauser, varqapass


Body Params: token, admintoken(optional)


Example: toekn=the_group_token&admintoken=if you want to join in channel as admin


Json Response: {"ok": true, "results": {"group_id": group_identity}}



CreateGroupChannel

Address: https://api.varqa.ir/group/create/

Method: POST


Header Params: varqauser, varqapass


Body Params as json: title, type


Json Example: {"title": "Leader Followers", "type": "group|channel"}


Json Response: {"ok": true, "results": {"group_id": group_identity, "token": "group|channel_token", "admintoken": "channel_admintoken"}}



BlockGroupChannel

Address: https://api.varqa.ir/group/block/

Method: POST


Header Params: varqauser, varqapass


Body Params as json: group_id


Json Example: {"group_id": 10023}


Json Response: {"ok": true}



UnblockGroupChannel

Address: https://api.varqa.ir/group/unblock/

Method: POST


Header Params: varqauser, varqapass


Body Params as json: group_id


Json Example: {"group_id": 10023}


Json Response: {"ok": true}



LeaveGroupChannel

Address: https://api.varqa.ir/group/leave/

Method: POST


Header Params: varqauser, varqapass


Body Params as json: group_id


Json Example: {"group_id": 10023}


Json Response: {"ok": true}



SendMessage

Address: https://api.varqa.ir/insert/

Method: POST


Header Params: varqauser, varqapass


Body Params as json: content, group_id


Json Example: {"content": "Hi World!", "group_id": 10023}


Json Response: {"ok": true, "results": {"message_id": message_identity}}



DeleteMessage

Address: https://api.varqa.ir/delete/

Method: GET


Header Params: varqauser, varqapass


Body Params: mid, gid


Example: mid=135131&gid=10023


Json Response: {"ok":true}



GetJoinedGroupsChannelsPVs

Address: https://api.varqa.ir/get/groups/

Method: GET


Header Params: varqauser, varqapass


Body Params: group_id, check(optional: check the groups changeds) *If you want to get members statuses set group_id except all and check true*


Example: group_id=all|10023&check=true|false


Json Response:

All group data: {"ok":true,"results":[{"gid":"10023","title":"Leader Followers","type":"channel","author":true,"blocked":false,"not_reads_count":"0","member_count":"2","group_login_info":{"token":"***","admintoken":"***"},"last_message":{"author":"you","content":"Hi World!"}]}

Group members statuses: {"ok":true,"results":[[{"user":"hosein","name":"Ali","status":"online"},{"user":"mohammad","name":"Mohammad","status":"2020|05/11|09:15"}]]}



GetMessages

Address: https://api.varqa.ir/get/data/

Method: GET


Header Params: varqauser, varqapass


Body Params: group_id, from(optional: before this message identity)


Example: group_id=10023&from=6513254


Json Response: {"ok":true,"results":[{"id":"6513253","content":"Hi World!","author":"you","date":"2020|05/11|11:30","not_reads_count":"1"}]}



GetNewMessages

Address: https://api.varqa.ir/get/updates/

Method: GET


Header Params: varqauser, varqapass


Body Params: group_id


Example: group_id=10023


Json Response: {"ok":true,"results":[{"id":"6513255","content":"Hi World!","author":"Ali","date":"2020|05/11|11:30","not_reads_count":"1"}]}



CheckMessageView

Address: https://api.varqa.ir/check/view/

Method: GET


Header Params: varqauser, varqapass


Body Params: mid, gid


Example: mid=135131,135132&gid=10023


Json Response: {"ok":true,"results":[{"mid":135131,"view":true}, {"mid":135132,"view":false}]}



SendFile

Address: https://api.varqa.ir/upload/

Method: POST


Header Params: varqauser, varqapass


Body Params: caption, File


Example: caption=Hi World! and C:\\user\Desktop\photo.jpg


Json Response: {"ok": true, "msg": "File(s) Received Successfully", "results": {"message_id": message_identity}}