This section handles authentication.

GET /sessions/{session}

This method gets the name of the user to whom the provided session belongs or error in case the session does not exist.

Request parameters:

    • company [obligatorio]: The company name or id.
    • session [obligatorio]: the session code.

Response:

    • status: returns "0" on success, and an error code in any other case.
    • data: returns the code of the user to whom the session belongs in case of success or the link to the request help in case of failure.
    • message: "Success" or a descriptive information of the error in any other case.

Example:

Request:

{"type":"get",

"url":"sessions/neQXoKWYLALJ1yVjr5d2ANOhZrwp52p5qeyM7WdzAi96rJ5QKmGHsIyF5tzV",

"data":"company=testco"}


Reponse (success):

{"status":"0",

"data":"ADMIN",

"message":"Success"}


Reponse (error):

{"status":"1007",

"data":"<a href='http:\/\/127.0.0.1:8080\/edinnM2\/help\/en\/API_Sessions.html'>for additional information follow this link<\/a>",

"message":"Session not stablished"}

POST /sessions

This method creates a new session, it allows you to log in the API. You have to provide your credentials and the method return you a session Id. You need this session Id in order to use all the other resources of the API.

If your company is not on that server, the correct server will be specified in the response message.

Request parameters:

    • company [mandatory]: The company name or id.
    • user [mandatory]: The user identifier.
    • password  [mandatory]: The user password.
    • device: The device id.

Response:

    • status: returns "0" on success, and an error code in any other case.
    • data: returns the session code on success or the link to the request help on error.
    • message: "Success" or a descriptive information of the error in any other case.

Example:

Request:

{"type":"post",

"url":"sessions",

"data":"company=testco&user=admin&password=1234&device=init"}


Reponse (success):

{"status":"0",

"data":"neQXoKWYLALJ1yVjr5d2ANOhZrwp52p5qeyM7WdzAi96rJ5QKmGHsIyF5tzV",

"message":"Success"}


Response (error):

{"status":"1004",

"data":"<a href='http:\/\/127.0.0.1:8080\/edinnM2\/help\/en\/API_Sessions.html'>for additional information follow this link<\/a>",

"message":"Incorrect credentials"}

DELETE /sessions/{session}

This method deletes a specific session, it allows you to log out the API.

Request attribute:

    • session: The Id of the session to delete.

Request parameters:

    • company: The company name or id.

Response:

    • status: Returns "0" on success, and an error code in any other case.
    • data: true if the session has been successfully deleted.
    • message: "Success" or a descriptive information of the error in any other case.

Example:

Request:

{"type":"delete",

"url":"sessions/neQXoKWYLALJ1yVjr5d2ANOhZrwp52p5qeyM7WdzAi96rJ5QKmGHsIyF5tzV",

"data":"company=testco"}


Reponse:

{"status":"0",

"data":true,

"message":"Success"}