Get Users
The Get User API is designed to retrieve a list of user profiles from our platform for an Organisation
.
Always ensure that sensitive users data is handled securely and in compliance with data protection regulations.
API Endpoint
Method: GET
URL: https://<PA_RM_END_POINT>/retail-media/users/{organisationId}
Request Header
Name | Value |
---|---|
Content-Type | application/json |
Authorization | Bearer ACCESS_TOKEN |
Please refer to the Authentication API documentation for bearer token.
Path Parameters
Parameter | Type | Description |
---|---|---|
organisationId | string | Organisation ID for the supplier or retailer whom the user will belongs. |
Please refer to the Retailer API or Supplier API for the respective organisation ID.
Query Parameters
Parameter | Type | Description |
---|---|---|
page | integer | The page number of the user list. Defaults to 1 if not specified. |
limit | integer | The number of users to return per page. Defaults to 10 but can be set as needed up to a maximum of 100 . |
organisationId
is the ID of the Retailer/Supplier's organisation whose users you want to retrieve. If no organisationId
is provided, the API will return a list of all users across all organisations that are active for the connected application.
Response Payload
Success Response
- Status Code:
200 OK
- Payload: Returns list of users associated with the organisation in JSON format
{
"status": "Success",
"message": "Data retrieved successfully",
"data": [
{
"id": "xxxxxxxxxxxxxxxxxxxxxxxxx",
"organisationId": "xxxxxxxxxxxxxxxxxxxxxxxxx",
"username": "adamsmith",
"firstname": "Adam",
"lastname": "Smith",
"mobile": "+401234",
"email": "adam@abc.com"
}
],
"pagination": {
"totalItems": "20",
"currentPage": "1",
"pageSize": "10",
"hasPreviousPage": false,
"hasNextPage": true
}
}
Response Parameters
Parameter | Type | Description |
---|---|---|
users | Array of Object | Array of users. |
totalItems | integer | Total number of users available for the given organisation. |
totalPages | integer | Total number of pages available for the given organisation. |
currentPage | integer | Current page number for the list of users. |
pageSize | integer | Number of users returned per page. |
hasPreviousPage | boolean | Indicates if previous page is available. |
hasNextPage | boolean | Indicates if next page is available. |
User Object
Parameter | Type | Description |
---|---|---|
id | string | Unique identifier for the user. |
organisationId | string | Unique identifier of the organisation for the user. |
username | string | Username of the user. |
firstname | string | First name of the user. |
lastname | string | Last name of the user. |
mobile | string | Mobile number of the user. |
email | string | Email address of the user. |
Error Response
If an error occurs, the API will return an appropriate status code along with an error message.
- Sample Error Response:
{
"status": "Error"
"errorCode": 401,
"errors": ["error message 1", "error message 2"],
"message": "Details error message",
"metadata": {
"requestId": "3d65d860-5acd-4663-b14d-c0bb55317660",
"timeStamp": "2025-04-28T00:00:00.000Z"
},
}
Example Usage (JavaScript)
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "BEARER YOUR_ACCESS_TOKEN");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect:'follow'
};
fetch("https://<PA_RM_END_POINT>/retail-media/users/{organisationId}", requestOptions)
.then(response => response.json())
.then(result=> {
console.log(result);
})
.catch(error => console.log('error', error));