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:
xxxxxxxxxx
{
"message": "operation was successful.",
"data": "[response object or array]"
}
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:
xxxxxxxxxx
{
"message": "operation was successful.",
"data": "[resopnse object or array]"
}
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:
xxxxxxxxxx
{
"message": "you had some invalid parameters. please check them."
}
401: Authentication Error
This error occurs when the user has sent his session information incorrectly or not at all.
HTTP Status Code: 401
Response:
xxxxxxxxxx
{
"message": "you are not authenticated."
}
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:
xxxxxxxxxx
{
"message": "you don't have enough credit for request entity/endpoint."
}
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:
xxxxxxxxxx
{
"message": "you don't have permission to the requested entity/endpoint."
}
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:
xxxxxxxxxx
{
"message": "your requested endpoint/entity not found."
}
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:
xxxxxxxxxx
{
"message": "you have used an invalid verb in your request. please check it."
}
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:
xxxxxxxxxx
Authorization: bearer ACCESS_TOKEN
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:
xxxxxxxxxx
Context: CONTEXT_OF_CLIENT_PRODUCT
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.