Skip to main content

Get Many Sessions

Endpoint Overview​

This API endpoint is designed to retrieve information about multiple sessions from the Juleb ERP system. It allows you to efficiently fetch data for a group of sessions in a single request, rather than making individual requests for each session.

Endpoint Details​

  • Method: GET
  • URL: /api/v1/pos/session

Parameters​

  • Path Parameters: None
  • Query Parameters:
    • fields (string, not required): Fields to include in the response separated by comma. If not provided, all fields are returned.
    • filter (string, not required): Apply conditions to filter the data returned.
    • limit (integer, not required): Limit the number of records returned. Default is 10, Max is 1000.
    • page (integer, not required): Page the records returned. Default is 1.

Response​

  • 200 OK: Successfully retrieved the record.
  • 400 Bad Request: Invalid parameters.
  • 401 Unauthorized: Authentication required.

Response Body​

{
"data": [
...records
],
"meta": {
"count": integer,
"total": integer
},
"pagination": {
"previousPage": integer | null,
"currentPage": integer,
"nextPage": integer | null,
"totalPages": integer
}
}

Example​

Request​

const axios = require('axios');
const accountName = process.env.ACCOUNT_NAME;
const apiKey = process.env.API_KEY;

axios.get(`https://${accountName}.juleb.com/api/v1/pos/session`, {
headers: {
'accept': '*/*',
'Authorization': `Bearer ${apiKey}`
},
params: {
fields: 'name,config_id,state,user_id',
filter: 'state!=closed',
page: 2,
limit: 10
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});

Response​

{
"data": [
{
"name": "POS/01723",
"config_id": 13,
"state": "opened",
"user_id": 676
},
{
"name": "POS/01725",
"config_id": 351,
"state": "opened",
"user_id": 2
},
{
"name": "POS/01726",
"config_id": 3,
"state": "opened",
"user_id": 2
},
{
"name": "POS/01714",
"config_id": 36,
"state": "opened",
"user_id": 454
},
{
"name": "POS/01724",
"config_id": 6,
"state": "opened",
"user_id": 52
},
{
"name": "POS/01715",
"config_id": 154,
"state": "opened",
"user_id": 52
},
{
"name": "POS/01553",
"config_id": 346,
"state": "opened",
"user_id": 52
},
{
"name": "POS/00492",
"config_id": 51,
"state": "opened",
"user_id": 172
},
{
"name": "POS/01716",
"config_id": 542,
"state": "opened",
"user_id": 52
},
{
"name": "POS/00848",
"config_id": 306,
"state": "new_session",
"user_id": 52
}
],
"meta": {
"count": 10,
"total": 41
},
"pagination": {
"previousPage": 1,
"currentPage": 2,
"nextPage": 3,
"totalPages": 5
}
}