Skip to main content

GET /api/users/{userId}

The GET /api/users/{userId} endpoint allows you to retrieve the details of a specific user registered in the system. It provides comprehensive information about the user, including name, email, country, time zone, and other important attributes. This endpoint is useful for user management, allowing system administrators to review and manage the data of a particular user.

This endpoint is especially beneficial for applications that need to display detailed user information or for administrators who need to verify or update a specific user's data.

Request Details

HTTP Method: GET URL: /api/users/{userId}

Request Parameters

ParameterTypeRequiredDescription
userIdstringYesThe unique identifier of the user.

Authentication Required

Authentication required to use the endpoint is via a Bearer token. This authentication method implies that each request must include an authorization header with a valid access token. This Bearer token acts as a credential that verifies the identity of the user or application making the request, ensuring that only authorized entities can modify the user's information. By requiring this type of authentication, the system guarantees a high level of security and access control, protecting users' data against unauthorized access.

Example Request

GET /api/users/12345 HTTP/1.1
Host: api.plaspy.com
Authorization: Bearer {your_auth_token}

Response Parameters

The response from this endpoint contains a detailed structure of the user. The following table describes the fields in the response:

FieldTypeRequiredDescription
successbooleanNoIndicates whether the request was successful.
errorstringNoContains the error message if success is false.
apiUsageintegerNoCurrent API usage by the user.
apiDailyUsageintegerNoDaily API usage by the user.
idstringNoUnique identifier of the user.
namestringYesName of the user.
emailstringYesEmail of the user.
countrystringYesCountry of the user.
timeZonestringYesTime zone of the user.
descriptionstringNoAdditional description of the user.
messagestringNoMessage associated with the user.
disabledbooleanNoIndicates whether the user is disabled.
disabledMessagestringNoMessage describing why the user is disabled.
tagsobjectNoSet of tags associated with the user.
privilegesarrayNoList of user privileges.
groupstringNoGroup to which the user belongs.
deviceIdstringNoIdentifier of the user's device.
adminDevicesintegerNoNumber of devices managed by the user.
fromstringNoStart date and time of the user's activity.
expiresstringNoExpiration date and time of the user.
passwordstringNoUser's password (encrypted).
creationstringNoDate and time the user was created.
modificationstringNoDate and time of the user's last modification.
lastLoginstringNoDate and time of the user's last login.

Example Successful Response

{
"success": true,
"apiUsage": 150,
"apiDailyUsage": 15,
"id": "usr-12345",
"name": "John Doe",
"email": "john.doe@example.com",
"country": "USA",
"timeZone": "America/New_York",
"description": "System Administrator",
"message": null,
"disabled": false,
"disabledMessage": null,
"tags": {
"role": "admin"
},
"privileges": ["read", "write", "execute"],
"group": "Admins",
"deviceId": "dev-67890",
"adminDevices": 5,
"from": "2023-01-01T00:00:00Z",
"expires": "2024-01-01T00:00:00Z",
"password": null,
"creation": "2023-01-01T00:00:00Z",
"modification": "2023-06-01T00:00:00Z",
"lastLogin": "2024-05-01T00:00:00Z"
}

Example Error Response

{
"success": false,
"error": "User not found.",
"apiUsage": 150,
"apiDailyUsage": 15
}

Plaspy GPS Tracking Platform

Explore the Plaspy platform and compatible GPS devices

Browse technical guides, application documentation, compatible trackers, and setup resources to get more value from Plaspy.