Sessions

The sleekshop sessions are used to identify the user interacting with the frontend, which sends and receives data from the backend via API. Some functions doesn't need to identify the special user like get_products_in_category or similar functions. But a lot functions need session. If you add an item into your cart, the users cart is stored in the sleekshop - backend and you as an developer need to know to which visitor the cart belongs. Therefore we need sessions.

This sessions has to be stored on the frontend - side of the corresponding user, for instance in a cookie.

The session model

The session model is the object type returned by the sessions endpoints. It can be used throughout the user session to store the cart and logged in state of a user.

Properties

  • Name
    object
    Type
    string
    Description

    Unique identifier for the object type returned.

  • Name
    creation_date
    Type
    timestamp
    Description

    The creation date of the session.

  • Name
    expiration_date
    Type
    timestamp
    Description

    The expiration date of the session.

  • Name
    code
    Type
    string
    Description

    The code of the session.


POSTget_new_session

Get new session

This endpoint gets a new session in sleekshop which allows you to store cart and logged in state of a user.

Request

POST
get_new_session
curl https://demo.sleekshop.net/srv/service/ \
    -d licence_username='demo_NBSqhrcrhMci15Ir9UWI' \
    -d licence_password='s9vmrbwT23B7bmjR4Vmz' \
    -d request='get_new_session'

Response

{
    "object":"session",
    "creation_date":"2018-05-01 14:56:27",
    "expiration_date":"2018-05-02 14:56:27",
    "code":"15251865878APL58l9IgZJ79jZb5IS7kMCue0KdAIX"
}

Was this page helpful?