EMS Groups Resource

From RAD Studio
Jump to: navigation, search

Go Up to EMS Administrative API


The EMS database stores data about the groups of registered users of your application. You can access this information by using the registered Groups Resource.

You can use the EMS Groups to authorize (allow or deny) a group of EMS Users to access a particular EMS Resource of your EMS Server (depending on the credentials in the HTTP request).

Note: Use the TEMSClientAPI or the TBackendGroups components to create, update, or delete an EMS Group, or to add EMS Users to existing EMS Groups.

Groups Resource Endpoints

Groups Resource exposes the following EMS Resource Endpoints:

Endpoint Method Name Resource Suffix HTTP Request Type Use

GetGroups

--

HTTP GET

To retrieve all data from Groups Resource.

GetGroup

{item}

HTTP GET

To retrieve all data from a Group.
item is the unique EMS Group name in the EMS database.

GetGroupFields

fields

HTTP GET

To retrieve the field names of all EMS Groups.

AddGroup

--

HTTP POST

To add a new Group to the EMS database.

UpdateGroup

{item}

HTTP PUT

To update a Group in the EMS database.
item is the unique EMS Group name in the EMS database.

DeleteGroup

{item}

HTTP DELETE

To delete a Group from the EMS database.
item is the unique EMS Group name in the EMS database.

GetGroups Endpoint

Returns a list of EMS Groups data.

Use the QueryGroups method, TBackendGroups or the TBackendQuery components and the Groups resource to retrieve the list of EMS Users.

If successful, the response from the EMS server provides a list of all EMS Groups with details about each one of them.

  • name
  • _meta (creator, created date and updated date fields)
  • users
  • Custom fields (optional)

Example Response

This is an example response:

[
    {
        "name": "testgroup",
        "_meta": {
            "creator": "00000000-0000-0000-0000-000000000001",
            "created": "2014-08-20T11:08:56.000Z"
        },
        "description": "Created by EMS setup.",
        "users": [
            "24EDA495-90FC-4BC4-9626-C87783357948"
        ]
    },
    {
        "name": "admins",
        "_meta": {
            "creator": "00000000-0000-0000-0000-000000000001",
            "created": "2014-08-20T11:08:56.000Z",
            "updated": "2014-08-20T11:09:56.000Z"
        },
        "users": [
            "24EDA495-90FC-4BC4-9626-C87783357948",
            "AB4900CC-CD7A-4890-B20D-9A3E65B450C7"
        ]
    }
]

GetGroup Endpoint

Returns the data of a specified EMS Group.

Your request must provide the following field:

  • name

Use the RetrieveGroup method, the TBackendGroups or the TBackendQuery components and the GroupName to retrieve its data.

If successful, the response from the EMS server provides EMS Group with details.

  • name
  • _meta (creator, created and updated fields)
  • users
  • Custom fields (optional)

Example Response

This is an example response to the request for group name "testgroup" :

{
    "name": "testgroup",
    "_meta": {
        "creator": "00000000-0000-0000-0000-000000000001",
        "created": "2014-08-20T11:08:56.000Z"
    },
    "description": "Created by EMS setup.",
    "users": [
        "24EDA495-90FC-4BC4-9626-C87783357948"
    ]
}

GetFields Endpoint

Retrieves the field names of all EMS Groups from the EMS database.

Use the RetrieveGroupsFields method to retrieve the fields of an EMS Group.

If successful, the response from the EMS server provides all the field names of the EMS Groups .

  • name
  • _meta (creator, created and updated fields)
  • users

Example Response

This is an example response:

[  
   {  
      "name":"groupname"
   },
   {  
      "name":"_meta",
      "fields":[  
         {  
            "name":"creator"
         },
         {  
            "name":"created"
         },
         {  
            "name":"updated"
         }
      ]
   },
   {  
      "name":"users"
   },
   {  
      "name":"description",
      "custom":true
   }
]

AddGroup Endpoint

Adds a new group to the EMS database.

Your request must provide the following field:

  • name

Use the TEMSClientAPI.CreateGroup method or the CreateGroup method of TBackendGroups component to add a new EMS Group.

UpdateGroup Endpoint

Updates the data of an existing EMS Group that is stored in the EMS database.

Your request must provide at least the following field:

  • name

Use the TEMSClientAPI.UpdateGroup method or the UpdateGroup method of TBackendGroups component to update the data of an existing EMS Group.

DeleteGroup Endpoint

Deletes an existing EMS Group from the EMS database.

Your request must provide the following field:

  • name

Use the TEMSClientAPI.DeleteGroup method or the DeleteGroup method of TBackendGroups component to delete an existing EMS Group.

EMS Groups Fields

Groups resource in EMS request and responses may include any combination of the following fields:

Item Example Description
"name"
"admins"

Unique EMS Group name in the EMS database.

"_meta"
{
    "creator": "00000000-0000-0000-0000-000000000001",
    "created": "2014-08-20T11:08:56.000Z",
    "updated": "2014-08-20T11:09:56.000Z"
}
  • creator: EMS Group creator in the EMS database.
  • created: Creation time of the EMS Group.
  • updated: Time when the EMS Group has been updated.
"users"
[
    "24EDA495-90FC-4BC4-9626-C87783357948",
    "AB4900CC-CD7A-4890-B20D-9A3E65B450C7"
]

List of EMS Users that belong to that EMS Group.

Custom fields

"myCustomField": "My Custom Field description"

Additional stored information for the EMS Group.

See Also