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

How to get all user-defined fields using the web services API

Audience:
api
Some tooltip text!
• 2 minutes to read
 • 2 minutes to read

This guide describes how to get all user-defined fields using the web services API.

Steps

The following REST code snippets use plain http requests to demonstrate how to perform the operation. The WebApi code snippet demonstrates how to perform the same operation using our nuget package SuperOffice.WebApi.

  • RESTful REST API
  • HTTP RPC Agent API
  • SuperOffice.WebApi

The following examples demonstrate how to get all user-defined fields for a company, using the api/v1/Contact/UdefLayout endpoint. To get the all user-defined fields for a different entity, use the api/v1/{entity}/UdefLayout entity endpoint, i.e. api/v1/Person/UdefLayout, api/v1/Project/UdefLayout etc.

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

The following examples demonstrate how to get all user-defined fields for a company, using the OwnerType parameter. To get the all user-defined fields for a different entity, use the appropriate OwnerType value.

POST https://{{env}}.superoffice.com/{{tenant}}/api/v1/Agents/UserDefinedFieldInfo/GetPublishedUserDefinedFieldList
Authorization: Bearer {{token}}
Accept: application/json; charset=utf-8
Content-Type: application/json; charset=utf-8

{
  "OwnerType": "Contact"
}

The following examples demonstrate how to get all user-defined fields for a company, using the OwnerType parameter. To get the all user-defined fields for a different entity, use the appropriate OwnerType value.

var config = new WebApiOptions(tenant.WebApiUrl);
config.Authorization = new AuthorizationAccessToken("8A:Cust12345.Example-Token", OnlineEnvironment.SOD);

var udefAgent = new UserDefinedFieldInfoAgent(config);
return await udefAgent.GetPublishedUserDefinedFieldListAsync(UDefType.Contact);
In This Article
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top