# List users GET https://content-gateway-example.com/v1/users Retrieve a paginated list of users using OData parameters. Reference: https://docs.moveworks.com/api-reference/content-gateway/list-users ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: List users version: endpoint_.listUsers paths: /users: get: operationId: list-users summary: List users description: Retrieve a paginated list of users using OData parameters. tags: - [] parameters: - name: $top in: query description: Number of items to return per page (default pagination) required: false schema: type: integer - name: $skip in: query description: Number of items to skip (default pagination offset) required: false schema: type: integer - name: $skiptoken in: query description: >- Used when the query parameters can be memoized into an encoded string containing filtering and pagination parameters. If the endpoint supports memoized paging, the first call can use $top and $skip, while @odata.nextLink will return with $skiptoken. If memoized querying is not supported, $top and $skip should be sufficient. required: false schema: type: string - name: $filter in: query required: false schema: type: string - name: $select in: query required: false schema: type: string - name: $orderby in: query required: false schema: type: string responses: '200': description: User list response content: application/json: schema: $ref: '#/components/schemas/UserCollection' '400': description: Bad Request - The request was invalid or cannot be served. content: {} '401': description: Unauthorized - The request requires user authentication. content: {} '403': description: >- Forbidden - The server understood the request but refuses to authorize it. content: {} '404': description: Not Found - The requested resource could not be found. content: {} '429': description: Too Many Requests - Rate limit exceeded. content: {} '500': description: >- Internal Server Error - The server encountered an unexpected condition. content: {} '503': description: >- Service Unavailable - The server is currently unable to handle the request. content: {} components: schemas: UserMetadata: type: object properties: {} User: type: object properties: id: type: string description: Unique identifier for the user. primary_email_addr: type: string description: Primary email address of the user. full_name: type: string description: Full name of the user. state: type: string description: 'State of the user account. Enum: Active | Inactive' last_modified_datetime: type: string description: Last modification timestamp (ISO 8601). metadata: $ref: '#/components/schemas/UserMetadata' description: Custom key-value metadata for the user. UserCollection: type: object properties: '@odata.context': type: string value: type: array items: $ref: '#/components/schemas/User' '@odata.nextLink': type: string ``` ## SDK Code Examples ```python import requests url = "https://content-gateway-example.com/v1/users" response = requests.get(url) print(response.json()) ``` ```javascript const url = 'https://content-gateway-example.com/v1/users'; const options = {method: 'GET'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://content-gateway-example.com/v1/users" req, _ := http.NewRequest("GET", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://content-gateway-example.com/v1/users") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://content-gateway-example.com/v1/users") .asString(); ``` ```php request('GET', 'https://content-gateway-example.com/v1/users'); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://content-gateway-example.com/v1/users"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://content-gateway-example.com/v1/users")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```