> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to get all list items

> How to get all list items via web service APIs

## Built-In lists

The advantage of using the List endpoint, when it comes to build in lists, it that it is very straightforward and easy to choose the correct method. The Agent APIs, including the HTTP RPC Agent API and proxy clients, have methods that are named the same as the list.

The method will return the list items with no added work. For example, the HTTP RPC Agent API GetCountries endpoint gets all countries.

Use the list name to get all list items for built-in lists.

<Tabs>
  <Tab title="RESTful REST API">
    ```http theme={null}
    GET https://{{env}}.superoffice.com/{{tenant}}/api/v1/List/Category/Items
    Authorization: Bearer {{token}}
    Accept: application/json; charset=utf-8
    ```
  </Tab>

  <Tab title="HTTP RPC Agent API">
    ```http theme={null}
    POST https://{{env}}.superoffice.com/{{tenant}}/api/v1/Agents/List/GetCategories HTTP/1.1
    Authorization: Bearer {{token}}
    Accept: application/json; charset=utf-8
    Content-Type: application/json; charset=utf-8
    ```
  </Tab>

  <Tab title="WebApi Proxy API">
    How to get all list items using the [SuperOffice.WebApi][1] proxy client.

    ```csharp theme={null}
    var config = new WebApiOptions(tenant.WebApiUrl);
    config.Authorization = new AuthorizationAccessToken("8A:Cust12345.Example-Token", OnlineEnvironment.SOD);
    var agent = new ListAgent(config);

    var listEntity = agent.GetCategoriesAsync().Result;
    ```
  </Tab>
</Tabs>

## User-defined lists

Use the prefix `udlist` and suffix `{listId}` to get all list items for user-defined lists. For example, given a user-defined list named "MyCustomList" has an Id value of 94, the list name to use is `udlist94`.

See the relevant examples below.

<Tabs>
  <Tab title="RESTful REST API">
    Must use the MDOList endpoint for user-defined lists.

    ```http theme={null}
    GET https://{{env}}.superoffice.com/{{tenant}}/api/v1/MDOList/udlist94 HTTP/1.1
    Authorization: Bearer {{token}}
    Accept: application/json; charset=utf-8
    ```
  </Tab>

  <Tab title="HTTP RPC Agent API">
    Must use the MDOList endpoint for user-defined lists. Both of the following options work.

    ```http theme={null}
    POST https://{{env}}.superoffice.com/{{tenant}}/api/v1/Agents/MDO/GetList HTTP/1.1
    Authorization: Bearer {{token}}
    Accept: application/json; charset=utf-8
    Content-Type: application/json; charset=utf-8

    {
      "Name": "udlist",
      "ForceFlatList": false,
      "AdditionalInfo": "94",
      "OnlyHistory": false
    }
    ```

    or

    ```http theme={null}
    POST https://{{env}}.superoffice.com/{{tenant}}/api/v1/Agents/MDO/GetList HTTP/1.1
    Authorization: Bearer {{token}}
    Accept: application/json; charset=utf-8
    Content-Type: application/json; charset=utf-8

    {
      "Name": "udlist94",
      "ForceFlatList": false,
      "AdditionalInfo": "",
      "OnlyHistory": false
    }
    ```
  </Tab>

  <Tab title="WebApi Proxy API">
    How to get all list items using the [SuperOffice.WebApi][1] proxy client.

    ```csharp theme={null}
    var config = new WebApiOptions(tenant.WebApiUrl);
    config.Authorization = new AuthorizationAccessToken("8A:Cust12345.Example-Token", OnlineEnvironment.SOD);
    var agent = new MDOAgent(config);

    var listEntity = agent.GetListAsync("udlist94").Result;
    ```
  </Tab>
</Tabs>

[Back](./index)

[1]: ../../../web-services/proxies/index


## Related topics

- [How to get all lists](/en/api/lists/services/how-to/get-all-lists.md)
- [How to list all selected interests for a contact (services)](/en/api/web-services/howto/company/get-interests-for-contact-services.md)
- [How to get a specific list item](/en/api/lists/services/how-to/get-list-item.md)
- [How to create a list item](/en/api/lists/services/how-to/create-list-item.md)
- [How to delete a list item](/en/api/lists/services/how-to/delete-list-item.md)
