SchoolApiV1
GET Product Users API Endpoint
Product Users API Endpoint
Overview
The Product Users API Endpoint
allows you to retrieve users who are associated with a specific product. This endpoint is part of the v1
API version and is accessible via the GET
HTTP method. It supports optional filtering of suspended and cancelled users.
Endpoint
- URL:
https://codeline.app/api/v1/products/[productId]/users
- Method:
GET
Headers
- Authorization: Include the bearer token in the
Authorization
header. The token must be prefixed withBearer
.
Query Parameters
includeSuspended
(boolean, optional): Include suspended users if set totrue
.includeCancelled
(boolean, optional): Include cancelled users if set totrue
.page
(number, optional): Specify the page number for pagination.
JavaScript Example
Here is an example of how to call the API using JavaScript:
Response type
Error Handling
- Ensure the bearer token is valid and included in the request headers.
- Handle any errors by checking the response status and logging appropriate messages.
This example demonstrates how to construct the request URL with query parameters, set the necessary headers, and handle the response. Adjust the productId
and token
variables with your actual values to use this example in your application.