2

I've implemented an application using Moqui Framework. I have entities with 10 parameters. Via RestService, using the short-alias of an entity I can get its 10 parameters on JSON format. However I only need 4 parameters to be displayed. This is my actual result:

    "exampleId": "100000",
    "exampleTypeEnumId": "EXT_MADE_UP",
    "description": "Yet another test description",
    "exampleEmail": "example1@test.com",
    "statusId": "EXST_IN_DESIGN",
    "exampleName": "Test Example from JSON File",
    "exampleSize": 123,
    "testTime": "1970-01-01T06:30:00+0000",
    "amount": 200.0,
    "exampleItemSeqId": "02",

And this is my desired result:

    "description": "Yet another test description",
    "exampleName": "Test Example from JSON File",
    "amount": 200.0,
    "exampleItemSeqId": "02",
Rolla
  • 61
  • 1
  • 7

1 Answers1

1

There are three approaches to getting limited entity fields through the Moqui REST API features:

  1. use the automatic entity REST API (/rest/e1) with a view-entity that only aliases the fields you want
  2. use a view-entity with limited fields aliased in a method.entity element in a Service REST API XML file (accessed through /rest/s1)
  3. define a service with just the fields you want and use it in a method.service element in a Service REST API XML file (accessed through /rest/s1)
David E. Jones
  • 1,721
  • 1
  • 9
  • 8
  • Thank you for valuable suggestion.I have implemented the second option and it was working fine. – Rolla Apr 25 '16 at 10:24