Email Groups
============

get\__email_groups
------------------

**Code samples**

.. code:: shell


   #  You can also use wget

   curl -X GET https://PEM-SERVER-IP/api/v14/email/groups \
     -H Accept: application/json \
     -H X-Auth-Token: string

.. code:: python

   import requests
   headers = {
     Accept: application/json,
     X-Auth-Token: string
   }

   r = requests.get(https://PEM-SERVER-IP/api/v14/email/groups, headers = headers)

   print(r.json())

.. code:: javascript


   const headers = {
     Accept:application/json,
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/api/v14/email/groups,
   {
     method: GET,

     headers: headers
   })
   .then(function(res) {
       return res.json();
   }).then(function(body) {
       console.log(body);
   });

``GET /email/groups``

- Retrieve the email groups list.\*

Parameters
^^^^^^^^^^

.. csv-table::
  :header: Name,In,Type,Required,Description
  :widths: 11,7,7,7,17
  :align: left
  :class: longtable

  X-Auth-Token,header,string,true,Token of authorization

**Example responses**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   [
     {
       "id": 0,
       "oid": 0,
       "gid": 0,
       "name": "string",
       "to_addr": "string",
       "cc_addr": "string",
       "bcc_addr": "string",
       "from_addr": "string",
       "reply_to_addr": "string",
       "subject_prefix": "string",
       "from_time": "00:00:00",
       "to_time": "23:59:59"
     }
   ]

.. raw:: html

   </Details>

Responses
^^^^^^^^^

.. csv-table::
  :header: Status,Meaning,Description,Schema
  :widths: 15,12,12,20
  :align: left
  :class: longtable

  200,:ref:`Invoking the server installer from the command line<Invoking the server installer from the command line>` ,Status 200,Inline

Response Schema
^^^^^^^^^^^^^^^

Status Code **200**

.. csv-table::
  :header: Name,Type,Required,Restrictions,Description
  :widths: 12,8,8,8,12
  :align: left
  :class: longtable

  *anonymous*,\ :ref:`Query information <Schemas>` ],false,none,none
  » id,integer,false,none,Email group ID
  » oid,integer,false,none,Email group options ID
  » gid,integer,false,none,Email group ID
  » name,string,false,none,Email group name
  » to_addr,string,false,none,Email group options receiver address
  » cc_addr,string,false,none,Email group options CC address
  » bcc_addr,string,false,none,Email group options BCC address
  » from_addr,string,false,none,Email group options sender address
  » reply_to_addr,string,false,none,Email group options reply to address
  » subject_prefix,string,false,none,Email group options subject prefix
  » from_time,string,false,none,Email group options from time to select time range for members
  » to_time,string,false,none,Email group options to time to select time range for members

..  Note::
   This operation does not require authentication

post\__email_groups
-------------------

**Code samples**

.. code:: shell


   #  You can also use wget

   curl -X POST https://PEM-SERVER-IP/api/v14/email/groups \
     -H Content-Type: application/json \
     -H X-Auth-Token: string

.. code:: python

   import requests
   headers = {
     Content-Type: application/json,
     X-Auth-Token: string
   }

   r = requests.post(https://PEM-SERVER-IP/api/v14/email/groups, headers = headers)

   print(r.json())

.. code:: javascript

   const inputBody = {
     "name": "string",
     "options": [
       {
         "to_addr": "string",
         "cc_addr": "string",
         "bcc_addr": "string",
         "from_addr": "string",
         "reply_to_addr": "string",
         "subject_prefix": "string",
         "from_time": "00:00:00",
         "to_time": "23:59:59"
       }
     ]
   };
   const headers = {
     Content-Type:application/json,
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/api/v14/email/groups,
   {
     method: POST,
     body: inputBody,
     headers: headers
   })
   .then(function(res) {
       return res.json();
   }).then(function(body) {
       console.log(body);
   });

``POST /email/groups``

- Add a new email group.\*

**Body parameter**

.. code:: json

   {
     "name": "string",
     "options": [
       {
         "to_addr": "string",
         "cc_addr": "string",
         "bcc_addr": "string",
         "from_addr": "string",
         "reply_to_addr": "string",
         "subject_prefix": "string",
         "from_time": "00:00:00",
         "to_time": "23:59:59"
       }
     ]
   }

.. _parameters-1:

Parameters
^^^^^^^^^^

.. csv-table::
  :header: Name,In,Type,Required,Description
  :widths: 11,7,7,7,17
  :align: left
  :class: longtable

  X-Auth-Token,header,string,true,Token of authorization
  body,body,:ref:`EmailGroupsPostData<EmailGroupsPostData>` ,true,none

**Example responses**

.. _responses-1:

Responses
^^^^^^^^^

.. csv-table::
  :header: Status,Meaning,Description,Schema
  :widths: 15,12,12,20
  :align: left
  :class: longtable

  200,:ref:`Invoking the server installer from the command line<Invoking the server installer from the command line>` ,Email group created successfully,None

.. _response-schema-1:

Response Schema
^^^^^^^^^^^^^^^

..  Note::
   This operation does not require authentication

get\_\ *email_groups*\ {email_group_id}
---------------------------------------

**Code samples**

.. code:: shell


   #  You can also use wget

   curl -X GET https://PEM-SERVER-IP/api/v14/email/groups/{email_group_id} \
     -H Accept: application/json \
     -H X-Auth-Token: string

.. code:: python

   import requests
   headers = {
     Accept: application/json,
     X-Auth-Token: string
   }

   r = requests.get(https://PEM-SERVER-IP/api/v14/email/groups/{email_group_id}, headers = headers)

   print(r.json())

.. code:: javascript


   const headers = {
     Accept:application/json,
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/api/v14/email/groups/{email_group_id},
   {
     method: GET,

     headers: headers
   })
   .then(function(res) {
       return res.json();
   }).then(function(body) {
       console.log(body);
   });

``GET /email/groups/{email_group_id}``

- Retrieve information for the email group, identified by the
  email_group_id.\*

.. _parameters-2:

Parameters
^^^^^^^^^^

.. csv-table::
  :header: Name,In,Type,Required,Description
  :widths: 11,7,7,7,17
  :align: left
  :class: longtable

  email_group_id,path,string,true,none
  X-Auth-Token,header,string,true,Token of authorization

**Example responses**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   {
     "id": 0,
     "oid": 0,
     "gid": 0,
     "name": "string",
     "to_addr": "string",
     "cc_addr": "string",
     "bcc_addr": "string",
     "from_addr": "string",
     "reply_to_addr": "string",
     "subject_prefix": "string",
     "from_time": "00:00:00",
     "to_time": "23:59:59"
   }

.. raw:: html

   </Details>

.. _responses-2:

Responses
^^^^^^^^^

.. csv-table::
  :header: Status,Meaning,Description,Schema
  :widths: 15,12,12,20
  :align: left
  :class: longtable

  200,:ref:`Invoking the server installer from the command line<Invoking the server installer from the command line>` ,Status 200,:ref:`EmailGroups<EmailGroups>` 

..  Note::
   This operation does not require authentication

put\_\ *email_groups*\ {email_group_id}
---------------------------------------

**Code samples**

.. code:: shell


   #  You can also use wget

   curl -X PUT https://PEM-SERVER-IP/api/v14/email/groups/{email_group_id} \
     -H Content-Type: application/json \
     -H X-Auth-Token: string

.. code:: python

   import requests
   headers = {
     Content-Type: application/json,
     X-Auth-Token: string
   }

   r = requests.put(https://PEM-SERVER-IP/api/v14/email/groups/{email_group_id}, headers = headers)

   print(r.json())

.. code:: javascript

   const inputBody = {
     "name": "string",
     "options": {
       "added": [
         {
           "to_addr": "string",
           "cc_addr": "string",
           "bcc_addr": "string",
           "from_addr": "string",
           "reply_to_addr": "string",
           "subject_prefix": "string",
           "from_time": "00:00:00",
           "to_time": "23:59:59"
         }
       ],
       "changed": [
         {
           "oid": 0,
           "to_addr": "string",
           "cc_addr": "string",
           "bcc_addr": "string",
           "from_addr": "string",
           "reply_to_addr": "string",
           "subject_prefix": "string",
           "from_time": "00:00:00",
           "to_time": "23:59:59"
         }
       ],
       "deleted": [
         {
           "oid": 0
         }
       ]
     }
   };
   const headers = {
     Content-Type:application/json,
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/api/v14/email/groups/{email_group_id},
   {
     method: PUT,
     body: inputBody,
     headers: headers
   })
   .then(function(res) {
       return res.json();
   }).then(function(body) {
       console.log(body);
   });

``PUT /email/groups/{email_group_id}``

- Update the email group information.\*

**Body parameter**

.. code:: json

   {
     "name": "string",
     "options": {
       "added": [
         {
           "to_addr": "string",
           "cc_addr": "string",
           "bcc_addr": "string",
           "from_addr": "string",
           "reply_to_addr": "string",
           "subject_prefix": "string",
           "from_time": "00:00:00",
           "to_time": "23:59:59"
         }
       ],
       "changed": [
         {
           "oid": 0,
           "to_addr": "string",
           "cc_addr": "string",
           "bcc_addr": "string",
           "from_addr": "string",
           "reply_to_addr": "string",
           "subject_prefix": "string",
           "from_time": "00:00:00",
           "to_time": "23:59:59"
         }
       ],
       "deleted": [
         {
           "oid": 0
         }
       ]
     }
   }

.. _parameters-3:

Parameters
^^^^^^^^^^

.. csv-table::
  :header: Name,In,Type,Required,Description
  :widths: 11,7,7,7,17
  :align: left
  :class: longtable

  email_group_id,path,string,true,none
  X-Auth-Token,header,string,true,Token of authorization
  body,body,:ref:`EmailGroupsPutData<EmailGroupsPutData>` ,true,none

**Example responses**

.. _responses-3:

Responses
^^^^^^^^^

.. csv-table::
  :header: Status,Meaning,Description,Schema
  :widths: 15,12,12,20
  :align: left
  :class: longtable

  200,:ref:`Invoking the server installer from the command line<Invoking the server installer from the command line>` ,Excluded databases added successfully,None

.. _response-schema-2:

Response Schema
^^^^^^^^^^^^^^^

..  Note::
   This operation does not require authentication

delete\_\ *email_groups*\ {email_group_id}
------------------------------------------

**Code samples**

.. code:: shell


   #  You can also use wget

   curl -X DELETE https://PEM-SERVER-IP/api/v14/email/groups/{email_group_id} \
     -H X-Auth-Token: string

.. code:: python

   import requests
   headers = {
     X-Auth-Token: string
   }

   r = requests.delete(https://PEM-SERVER-IP/api/v14/email/groups/{email_group_id}, headers = headers)

   print(r.json())

.. code:: javascript


   const headers = {
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/api/v14/email/groups/{email_group_id},
   {
     method: DELETE,

     headers: headers
   })
   .then(function(res) {
       return res.json();
   }).then(function(body) {
       console.log(body);
   });

``DELETE /email/groups/{email_group_id}``

- Delete the email group.\*

.. _parameters-4:

Parameters
^^^^^^^^^^

.. csv-table::
  :header: Name,In,Type,Required,Description
  :widths: 11,7,7,7,17
  :align: left
  :class: longtable

  email_group_id,path,string,true,none
  X-Auth-Token,header,string,true,Token of authorization

**Example responses**

.. _responses-4:

Responses
^^^^^^^^^

.. csv-table::
  :header: Status,Meaning,Description,Schema
  :widths: 15,12,12,20
  :align: left
  :class: longtable

  200,:ref:`Invoking the server installer from the command line<Invoking the server installer from the command line>` ,Email group deleted successfully,None

.. _response-schema-3:

Response Schema
^^^^^^^^^^^^^^^

..  Note::
   This operation does not require authentication
