HTTP API Resource - ReferenceSheetLine

ReferenceSheetLine

ReferenceSheetLines are records of a custom defined table structure through configuration. These are details of ReferenceSheet, that references the configuration that the lines adhere to. The configuration is stored using FlexCodeSystem and FlexCodeFieldUsages. ReferenceSheetLines are records based on the FlexCodeSystem configuration.

The HTTP API resource for ReferenceSheetLines has some special features and restrictions that are explained in the sections below.

The URL where referencesheetlines can be accessed is

POST http://[hostName]:[portNumber]/[api-context-root]/generic/referencesheetlines/[reference-sheet-resource-name]

If the resource name is unknown, the response is Not Found (404)

GET

Works as normal api. Get on the above url will return all reference sheet lines for that configured reference sheet resource name. A sample reply will look like below. The resource name of the reference sheet is 'setups', and fields like 'Character', 'NumberField', 'DateField' and 'FlexField' are configured fields.

{
   "offset" : 0,
   "count" : 2,
   "hasMore" : false,
   "limit" : 50,
   "items" : [ {
      "lastUpdatedBy" : 142,
      "objectVersionNumber" : 1,
      "createdBy" : 142,
      "id" : 13281,
      "uuid" : "ed7e14bd-9a65-4a30-819e-4910bff9985b",
      "startDate" : "2017-05-01",
      "links" : [ {
         "href" : "http://localhost:27001/api/generic/referencesheetlines/setups/13281",
         "rel" : "self"
      } ],
      "lastUpdatedDate" : {
         "value" : "2017-05-16T15:59:17.746+02:00"
      },
      "referenceSheet" : {
         "links" : [ {
            "href" : "http://localhost:27001/api/generic/referencesheets/13691",
            "rel" : "canonical"
         } ]
      },
      "Character" : "ABC",
      "NumberField" : 12,
      "DateField" : "2017-05-01",
      "FlexField" : {
          "code"    : "flexValue1",
          "flexCodeDefinitionCode: : "SIMPLE_FLEX"
       },
      "creationDate" : {
         "value" : "2017-05-16T15:59:17.746+02:00"
      }
   }, {
      "lastUpdatedBy" : 10,
      "objectVersionNumber" : 1,
      "createdBy" : 10,
      "id" : 13311,
      "uuid" : "d8668de6-2d03-40ad-9eb7-8b68324b9f89",
      "startDate" : "2009-01-01",
      "links" : [ {
         "href" : "http://localhost:27001/api/generic/referencesheetlines/setups/13311",
         "rel" : "self"
      } ],
      "lastUpdatedDate" : {
         "value" : "2017-05-16T16:56:42.897+02:00"
      },
      "referenceSheet" : {
         "links" : [ {
            "href" : "http://localhost:27001/api/generic/referenceSheets/13691",
            "rel" : "canonical"
         } ]
      },
      "Character" : "DEF",
      "NumberField" : 13,
      "DateField" : "2018-05-01",
      "FlexField" : {
          "code"    : "flexValue2",
          "flexCodeDefinitionCode: : "SIMPLE_FLEX"
       }
      "creationDate" : {
         "value" : "2017-05-16T16:56:42.897+02:00"
      }
   } ],
   "links" : [ {
      "rel" : "self",
      "href" : "http://localhost:27001/api/generic/referencesheetlines/setups
   } ]
}

QUERY API

Query API on reference sheet lines works as normal. The dynamic attributes have to be accessed through the usage name of the reference sheet and not directly. Taking the same example as above, if the usage name is setup, the query api syntax to search on NumberField will look something like

POST http://[hostName]:[portNumber]/[api-context-root]/generic/referencesheetlines/setups/search
{
  "resource": {
    "q": "setup.NumberField.eq(123)"
  }
}

The usage name join is used to identify that the property that is searched on is a configured property. For direct attributes, like startDate, usage name is not needed.

POST http://[hostName]:[portNumber]/[api-context-root]/generic/referencesheetlines/setups/search

{
  "resource": {
    "q": "setup.NumberField.eq(123).and.startDate.eq('2019-01-01')"
  }
}
Please note that like searches on flexcode based columns do not support escape sequence.

POST/PUT/PATCH

Insert/Update/Patch on referencesheetlines works as with other resources.

Sample payload for insert:

{
      "startDate" : "2009-01-01",
      "Character" : "DEF",
      "NumberField" : 13,
      "DateField" : "2018-05-01",
      "FlexField" : {
          "code"    : "flexValue1",
          "flexCodeDefinitionCode: : "SIMPLE_FLEX"
       }
}

DELETE

Delete works as with other resources.

Generic Features for Payload Representations:

  • Fields: Works as expected, with one exception that direct fields cannot be restricted. Sample reply with fields=referencesheet.id is:

{
   "offset" : 0,
   "count" : 2,
   "hasMore" : false,
   "limit" : 50,
   "items" : [ {
      "lastUpdatedBy" : 142,
      "objectVersionNumber" : 1,
      "createdBy" : 142,
      "id" : 13281,
      "uuid" : "ed7e14bd-9a65-4a30-819e-4910bff9985b",
      "startDate" : "2017-05-01",
      "links" : [ {
         "href" : "http://localhost:27001/api/generic/referencesheetlines/setups/13281",
         "rel" : "self"
      } ],
      "lastUpdatedDate" : {
         "value" : "2017-05-16T15:59:17.746+02:00"
      },
      "referenceSheet" : {
         "id" : 13691,
         "links" : [ {
            "href" : "http://localhost:27001/api/generic/referencesheets/13691",
            "rel" : "canonical"
         } ]
      },
      "Character" : "ABC",
      "NumberField" : 12,
      "DateField" : "2017-05-01",
      "FlexField" : {
          "code"    : "flexValue1",
          "flexCodeDefinitionCode: : "SIMPLE_FLEX"
       }
      "creationDate" : {
         "value" : "2017-05-16T15:59:17.746+02:00"
      }
   }, {
      "lastUpdatedBy" : 10,
      "objectVersionNumber" : 1,
      "createdBy" : 10,
      "id" : 13311,
      "uuid" : "d8668de6-2d03-40ad-9eb7-8b68324b9f89",
      "startDate" : "2009-01-01",
      "links" : [ {
         "href" : "http://localhost:27001/api/generic/referencesheetlines/setups/13311",
         "rel" : "self"
      } ],
      "lastUpdatedDate" : {
         "value" : "2017-05-16T16:56:42.897+02:00"
      },
      "referenceSheet" : {
         "id" : 13691,
         "links" : [ {
            "href" : "http://localhost:27001/api/generic/referencesheets/13691",
            "rel" : "canonical"
         } ]
      },
      "Character" : "DEF",
      "NumberField" : 13,
      "DateField" : "2018-05-01",
      "FlexField" : {
          "code"    : "flexValue2",
          "flexCodeDefinitionCode: : "SIMPLE_FLEX"
       }
      "creationDate" : {
         "value" : "2017-05-16T16:56:42.897+02:00"
      }
   } ],
   "links" : [ {
      "rel" : "self",
      "href" : "http://localhost:27001/api/generic/referencesheetlines/setups"
   } ]
}
  • Expand: Works as expected.

METADATA

Metadata for referencesheetlines/{resource_name} resource will contain information about all the native fields and all the configured fields on the related reference sheet with that resource name.