Account Module - Response

The Data object for a response from the Account module is defined below, in the order the fields are returned:

🟥 Data

TypeRequired
Objectyes

The Data object encapsulates the response data for a given module, and will always be present.

Fields: 🔸DataPath

Objects: 🟥 Errors[], 🟥 Warnings[], 🟥 Accounts[]

🔸 Data.DataPath

TypeRequired
Stringyes

The fully qualified directory name used by the SCE to find the clients.set file. If the SCE can not find the clients.set file in the data directory, or if the data direcotry does not exist, then an error will be returned.

🟥 Data.Errors[]

TypeRequired
Array of Stringyes

The Errors[] field contains an array of Strings which describe any errors encountered while handling the request. If the length of the Errors[] Array is zero (0), then the module processed the request successfully, and the Data object can be further processed by the calling application for the returned data.

On the other hand, if the length of the Errors[] Array is greater than zero (0), then this indicates that an error condition has been detected, and the calling application should not process the respons Data object further. In this case, the contents of the Errors[] array will describe the error(s) encountered.

Typical errors include the omission of 🟥 required fields, invalid field values, etc.


🟥 Data.Warnings[]

TypeRequired
Array of Stringyes

The Warnings[] field contains an array of Strings which describe any warnings generated by the module handling the request. The most common warnings returned by modules inform the calling application that the module does not recognize a specified field (which may help to isolate a field name spelling error in the calling application's code). Note that field names which start with "//" will bre treated as comment fields by the SCE, and no warnings will be generated for these unrecognized fields.

Example - Request and response illustrating warnings when passing unrecognized fields:

{
  "Module" : "Account",
  "Data" : {
    "//" : "This is a comment.",
    "Hello" : "Friend!",
    "How" : "are you?"
  }
}
{
  "Result" : 200,
  "Module" : "Account",
  "Data" : {
    "Errors" : [
    ],
    "Warnings" : [
      "Request field Data.Hello (String) not recognized.",
      "Request field Data.How (String) not recognized."
    ],
    "DataPath" : "/home/alank/Work/sce/SCE/data/",
    "Accounts" : [
      {
        "Account" : 1,
        "Title" : "Single Premium"
      },
      {
        "Account" : 2,
        "Title" : "MOB"
      },
      {
        "Account" : 3,
        "Title" : "True MOB"
      }
    ]
  }
}   

🟥 Data.Accounts[]

TypeRequired
array of Account Objectsyes

The Accounts[] array returns information on each account found in the clients.set file.

Fields: 🔸Account, 🔸Title

Objects:None

🔸 Data.Accounts[].Account

TypeRequiredValues
StringyesInteger > 0

Discloses the account number associated with this account in the clients.set file.

🔸 Data.Accounts[].Title

TypeRequiredValues
StringyesText

Holds the title of this account as it appears in the clients.set file.