Developer Guide
Understanding Magentrix Entities

    Magentrix Entities are categorized into four separate types, outlined below.

    • Schema based Entities: These entities are fixed in structure. Their fields cannot be modified or changed. Only administrators can perform queries against most of these entities. These entities define how the platform will operate. In REST these entities are referred to as "Setup" (aka "schema").
    • System based Entities: These entities are fixed in structure with the exception of "Event" and “Task” entities. In REST these entities are referred to as “Sys” (aka "system").
    • Standard based Entities:  These entities are not fixed. In REST these entities have no prefix (aka "standard"). These entities are considered User base entities and they are defined by a System Administrator. They are categorized into two groups of entities:
      • Object Entities
        • Object entities have the following standard fields defined:
          • Id – string
          • Name – string or integer, depending which option was used during creation of the object
          • OwnerId  – string
          • CreatedOn – DateTime
          • ModifiedOn – DateTime
          • CreatedById – string
          • ModifiedById – string
          • IsDeleted – boolean
      • Person Entities
        • Person entities have the following standard fields defined:
          • Id – string
          • Name –string, readonly. Combination of Firstname and Lastname
          • Firstname –string
          • Lastname –string
          • OwnerId  –string
          • CreatedOn – DateTime
          • ModifiedOn – DateTime
          • CreatedById – string
          • ModifiedById – string
          • IsDeleted – boolean
    • Force based Entities:
      These entities are not fixed. They map back to force.com objects and they mimic the same structure as the force.com object with which they are associated. In REST these entities are referred to as "Force".
    To find out about all the entities that exist in the system, you can use the following Query:
     
    https://<instance>.magentrix.com/rest/2.0/query?q=FROM Setup.Entity SELECT Id,Name,Schema
     
    Here's an example of the response body:
     
    {
        "Count": 3,
        "Records": [
            {
                "Id": "7NS00000000000s0000",
                "Name": "Activity",
                "Schema": "system"
            },
            {
                "Id": "7NS00000000008H0000",
                "Name": "Account",
                "Schema": "standard"
            },
            {
                "Id": "7NS00000000008O0000",
                "Name": "Contact",
                "Schema": "standard"
            }
        ]
    }
     
    Consequently you can query all the field of a specific entity as follows:
     
    https://<instance>.magentrix.com/rest/2.0/query?q=FROM Setup.EntityField WHERE EntityId == "[entityid]" SELECT Id,Name,FieldType
     
    Where [entityid] is Id of an existing entity such as “7NS00000000000s0000” the JSON response body will look as follows: 
     
    {
        "Count": 10,
        "Records": [
            {
                "FieldType": "Type = Opirus.Area.Sys.FieldType; Name = ID; Id = 7NY0000000000010000",
                "Id": "7NX0000000000Uu0000",
                "Name": "Id"
            },
            {
                "FieldType": "Type = Opirus.Area.Sys.FieldType; Name = Text; Id = 7NY0000000000000000",
                "Id": "7NX0000000000Uv0000",
                "Name": "Firstname"
            },
            {
                "FieldType": "Type = Opirus.Area.Sys.FieldType; Name = Text; Id = 7NY0000000000000000",
                "Id": "7NX0000000000Uw0000",
                "Name": "Lastname"
            },
            {
                "FieldType": "Type = Opirus.Area.Sys.FieldType; Name = Formula; Id = 7NY00000000000j0000",
                "Id": "7NX0000000000Ux0000",
                "Name": "Name"
            },
            {
                "FieldType": "Type = Opirus.Area.Sys.FieldType; Name = Lookup; Id = 7NY0000000000060000",
                "Id": "7NX0000000000Uy0000",
                "Name": "OwnerId"
            },
            {
                "FieldType": "Type = Opirus.Area.Sys.FieldType; Name = Checkbox; Id = 7NY0000000000050000",
                "Id": "7NX0000000000Uz0000",
                "Name": "IsDeleted"
            },
            {
                "FieldType": "Type = Opirus.Area.Sys.FieldType; Name = DateTime; Id = 7NY0000000000020000",
                "Id": "7NX0000000000UA0000",
                "Name": "CreatedOn"
            },
            {
                "FieldType": "Type = Opirus.Area.Sys.FieldType; Name = DateTime; Id = 7NY0000000000020000",
                "Id": "7NX0000000000UB0000",
                "Name": "ModifiedOn"
            },
            {
                "FieldType": "Type = Opirus.Area.Sys.FieldType; Name = Lookup; Id = 7NY0000000000060000",
                "Id": "7NX0000000000UC0000",
                "Name": "CreatedById"
            },
            {
                "FieldType": "Type = Opirus.Area.Sys.FieldType; Name = Lookup; Id = 7NY0000000000060000",
                "Id": "7NX0000000000UD0000",
                "Name": "ModifiedById"
            }
        ]
    }