Pajoohyar Core APIs Documention

The documentation provided describes how to work with all the APIs provided for the pajoohyar service. The pajoohyar API service is in the core project and you should go to the core project to view its source. The core project uses the Laravel framework. Its main database is MySQL. The dedicated service panel is located at this address. Here's how to connect to all APIs.

Response Types

There are several different types of response from the service that can be sent to the user. Each is separated by HTTP Status Code. Each is described below and an example is given below.

200: Successful Request

If the operation is successful. This answer will be returned. The data in response can be whatever the request is and the outcome of the operation.

HTTP Status Code: 200

Response:

201: Duplicate Successful Request

If the request has already been successfully resubmitted. This answer will be received. For example, the entity that was deleted in the previous request will resubmit the request.

HTTP Status Code: 201

Response:

400: Invalid Request Error

This error occurs when the user has entered incorrect entries or has not entered them at all. Some APIs require specific inputs and must be followed.

HTTP Status Code: 400

Response:

401: Authentication Error

This error occurs when the user has sent his session information incorrectly or not at all.

HTTP Status Code: 401

Response:

402: Credit Error

This error occurs when the user does not have sufficient credentials to use the requested resources or entity.

HTTP Status Code: 402

Response:

403: Permission Error

This error occurs when the user does not have access to the desired API. If the user has access to the desired API then it means that the user does not have access to the requested entity or resources.

HTTP Status Code: 403

Response:

404: Not Found Error

This error occurs when the user has the wrong address or endpoint requested. If the user has entered the endpoint correctly then there is no resource or entity requested. Another error is that the resources or resources requested by the user are hidden from view.

HTTP Status Code: 404

Response:

405: Bad Method Error

This error occurs when the verb user has sent the request incorrectly. For example the verb is POST but the user sent GET.

HTTP Status Code: 405

Response:

Authentication

Currently login and registration is only possible with a passport. But in addition, logging in through INoor and Google is also considered. Login and registration via passport uses the eargonomic technique. User authentication via email or mobile number is not considered. Some APIs marked with Auth require user login information in their Header. This requires the user to use the Login or Register APIs first and then request ACCESS_TOKEN in the header. As follows:

All requests must respect which pajoohyar product was sent from. Therefore, all requests in the header must contain a Context value. Each researcher product has its own separate context. For example Context of online library is onlib, or Context of online citation is cite. In other words, the following value should also be added to the header of all requests:

all request verbs are POST so don't bother yourself to change to verbs. all are POST and all Content-Type are multipart/form-data.

Here are its APIs:

/auth/passport/register

Parameters
nametypedescriptionexample
usernamestringrequire, max: 32, min: 6amiri1368
passwordstringrequire, max: 32, min: 6amiri1368
first_namestringrequire, max: 32amir
last_namestringrequire, max: 32jadidi
emailstringrequire, email addressamiri1368@yahoo.com
avatarfileimage type, max size: 2MB-
gendernumeric1 for male and 2 for female1
Success Response

/auth/passport/login

Parameters
nametypedescriptionexample
usernamestringmax: 32, min: 6amiri1368
passwordstringmax: 32, min: 6amiri1368
Success Response

/auth/passport/profile/show (auth)

Success Response

/auth/passport/profile/update (auth)

Parameters
nametypedescriptionexample
usernamestringrequire, max: 32, min: 6amiri1368
passwordstringrequire, max: 32, min: 6amiri1368
first_namestringrequire, max: 32amir
last_namestringrequire, max: 32jadidi
emailstringrequire, email addressamiri1368@yahoo.com
avatarfileimage type, max size: 2MB-
gendernumeric1 for male and 2 for female1
Success Response

/auth/passport/logout (auth)

Success Response

Collections

/collections/search/privates (auth)

Parameters
nametypedescriptionexample
collection_idnumericunique target collection id342
querystringpart of title or description"something"
titlestringpart of title"foo"
descriptionstringpart of description"bar"
tags[string]some of tags that collection owns["foo", "bar"]
offsetnumericoffset of results0
limitnumericlimit of results10
Success Response

/collections/search/publics

Parameters
nametypedescriptionexample
collection_idnumericunique target collection id342
querystringpart of title or description"something"
titlestringpart of title"foo"
descriptionstringpart of description"bar"
tags[numeric]some of tags that collection owns[3, 5]
offsetnumericoffset of results0
limitnumericlimit of results10
Success Response

/collections/create (auth)

Parameters
nametypedescriptionexample
titlestringmax: 128"foo"
descriptionstringmax: 1024"bar"
tags[numeric]array of tags by id[1, 5]
logofilemax size: 5MB-
coverfilemax size: 10MB-
Success Response

/collections/update (auth)

Parameters
nametypedescriptionexample
collection_idunique id of collection83 
titlestringmax: 128"foo"
descriptionstringmax: 1024"bar"
tags[numeric]array of tags by id[1, 5]
logofilemax size: 5MB-
coverfilemax size: 10MB-
Success Response

/collections/remove (auth)

Parameters
nametypedescriptionexample
collection_idnumericunique target collection id342
Success Response

/collections/subscribe (auth)

Parameters
nametypedescriptionexample
collection_idnumericunique target collection id342
Success Response

/collections/unsubscripe (auth)

Parameters
nametypedescriptionexample
collection_idnumericunique target collection id342
Success Response

Collection Membership

/collections/membership/create (auth)

Parameters
nametypedescriptionexample
user_idnumericunique target user id342
accessnumeric1: owner, 2: editor, 3: visitor2
Success Response

/collections/membership/update (auth)

Parameters
nametypedescriptionexample
membership_idnumericunique target membership id342
accessnumeric1: owner, 2: editor, 3: visitor2
Success Response

/collections/membership/remove (auth)

Parameters
nametypedescriptionexample
membership_idnumericunique target membership id342
Success Response

/collections/membership/submit-request (auth)

Parameters
nametypedescriptionexample
collection_idnumericunique target collection id342
Success Response

Items

/items/search/privates (auth)

Parameters
nametypedescriptionexample
item_idnumericunique target item id342
collection_idnumericunique collection id that owns item43
querystringpart of title or description"something"
titlestringpart of title"foo"
descriptionstringpart of description"bar"
tags[string]some of tags that item owns["foo", "bar"]
typenumerictype id of item25 (as newspaper article)
offsetnumericoffset of results0
limitnumericlimit of results10
Success Response

/items/search/publics

Parameters
nametypedescriptionexample
item_idnumericunique target item id342
collection_idnumericunique collection id that owns item43
querystringpart of title or description"something"
titlestringpart of title"foo"
descriptionstringpart of description"bar"
tags[string]some of tags that item owns["foo", "bar"]
typenumerictype id of item25 (as newspaper article)
offsetnumericoffset of results0
limitnumericlimit of results10
Success Response

/items/create (auth)

Parameters
nametypedescriptionexample
typenumerictype id of item25 (as newspaper article)
collection_idnumericunique collection id434
titlestringmax: 128"foo"
descriptionstringmax: 1024"bar"
tags[numeric]array of tags by id[1, 5]
fields[{"key": number, "value": string}]fields of item[]
Responses

/items/update (auth)

Parameters
nametypedescriptionexample
item_idnumerictarget item id34
typenumerictype id of item25 (as newspaper article)
collection_idnumericunique collection id434
titlestringmax: 128"foo"
descriptionstringmax: 1024"bar"
tags[numeric]array of tags by id[1, 5]
fields[{"key": number, "value": string}]fields of item[]
Responses

/items/remove (auth)

Parameters
nametypedescriptionexample
item_idnumericunique target item id342
Success Response

Notes

/notes/search

Parameters
nametypedescriptionexample
note_idnumericunique target note id483
item_idnumericunique target item id that owns note342
collection_idnumericunique collection id that owns note43
owner_idnumericunique user id that worte the comment443
querystringpart of title or body"something"
titlestringpart of title"foo"
bodystringpart of body"bar"
offsetnumericoffset of results0
limitnumericlimit of results10
Success Response

/notes/create (auth)

Parameters
nametypedescriptionexample
titlestringmax: 128"something"
bodystringmax: 1024"hello bar"
target_typenumeric1 => collection, 2 => item1
target_idnumericbased on target_type43
Success Response

/notes/update (auth)

Parameters
nametypedescriptionexample
note_idnumericunique target note id434
titlestringmax: 128"something"
bodystringmax: 1024"hello bar"
target_typenumeric1 => collection, 2 => item1
target_idnumericbased on target_type43
Success Response

/notes/remove (auth)

Parameters
nametypedescriptionexample
note_idnumericunique target note id342
Success Response

/notes/publish (auth)

Parameters
nametypedescriptionexample
note_idnumericunique target note id342
Success Response

/notes/unpublish (auth)

Parameters
nametypedescriptionexample
note_idnumericunique target note id342
Success Response

Comments

/comments/search

Parameters
nametypedescriptionexample
comment_idnumericunique target comment id483
item_idnumericunique target item id that owns comment342
collection_idnumericunique collection id that owns comment43
note_idnumericunique note id that owns comment43
owner_idnumericunique user id that worte the comment443
reply_idnumericunique user id that comment is replied to445
bodystringpart of body"bar"
publishednumeric1 => pending, 2 => published, 3 => unpublished1
offsetnumericoffset of results0
limitnumericlimit of results10
Success Response

/comments/submit (auth)

Parameters
nametypedescriptionexample
target_typenumeric1 => collection, 2 => item, 3 => note2
target_idnumericunique target id based on target_type32
reply_tonumericunique id of target comment, if replay id is entered then target_type and target_id have to be null445
bodystringcomment body, max: 512"oh! this is great."
Success Response

/comments/update (auth)

Parameters
nametypedescriptionexample
comment_idnumericunique comment id443
target_typenumeric1 => collection, 2 => item, 3 => note2
target_idnumericunique target id based on target_type32
reply_tonumericunique id of target comment, if replay id is entered then target_type and target_id have to be null445
bodystringcomment body, max: 512"oh! this is great."
Success Response

/comments/remove (auth)

Parameters
nametypedescriptionexample
comment_idnumericunique target comment id342
Success Response

/comments/publish (auth)

Parameters
nametypedescriptionexample
comment_idnumericunique target comment id342
Success Response

/comments/unpublish (auth)

Parameters
nametypedescriptionexample
comment_idnumericunique target comment id342
Success Response

Messages

/messages/send (auth)

Parameters
nametypedescriptionexample
titlestringmax: 128"hey budy!"
bodystringmax: 1024"let's be friend."
recipients[numeric]unique id of users[3, 43, 1]
attachments[file]max size of each file < 5 MB-
Success Response

/messages/search (auth)

Parameters
nametypedescriptionexample
typenumeric1 => me as sender, 2 => me as a recipient1
sender_idnumericunique target user id23
recipient_idnumericunique target user id45
querystringpart of title or body"h"
titlestringpart of title"h"
bodystringpart of body"h"
offsetnumericoffset of results0
limitnumericlimit of results10
Success Response

Users (auth)

/users/search (auth)

Parameters
nametypedescriptionexample
first_namestringpart of first name"ali"
last_namestringpart of last name"ali"
full_namestringpart of full name"ali"
user_udnumerictarget user id324
offsetnumericoffset of results0
limitnumericlimit of results10
Response

/users/follow (auth)

Parameters
nametypedescriptionexample
user_idnumericunique target user id342
Success Response

/users/unfollow (auth)

Parameters
nametypedescriptionexample
user_idnumericunique target user id342
Success Response

Logs

/logs/send

Parameters
nametypedescriptionexample
actionstringmax: 32"visited"
sub_actionstringmax: 64"null"
valuestringmax: 128"main_page"
infojson objectmax: 1024"{}"
Response