• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Edit
Show / Hide Table of Contents

How to get all list items

Some tooltip text!
• 2 minutes to read
 • 2 minutes to read

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.

  • RESTful REST API
  • HTTP RPC Agent API
  • WebApi Proxy API
GET https://{{env}}.superoffice.com/{{tenant}}/api/v1/List/Category/Items
Authorization: Bearer {{token}}
Accept: application/json; charset=utf-8
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

How to get all list items using the SuperOffice.WebApi proxy client.

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;

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.

  • RESTful REST API
  • HTTP RPC Agent API
  • WebApi Proxy API

Must use the MDOList endpoint for user-defined lists.

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

Must use the MDOList endpoint for user-defined lists. Both of the following options work.

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

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
}

How to get all list items using the SuperOffice.WebApi proxy client.

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;

Back

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top