PUT api/v2/addressbook/groups/{groupID}/contacts

This method adds a contact to selected group. The system will check that the user adding a contact is allowed. If the contact is already in the group, this method does nothing.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
groupID

ID of the group.

globally unique identifier

Required

Body Parameters

Either xml or json request.

TwoSms.CustomerPortalRole.API.AddressBooks.GroupMemberRequest
NameDescriptionTypeAdditional information
All

Determines whether to add/remove all members in the address book depending on request type.

boolean

None.

Contacts

List of all the person numbers to add/remove. Depending on the request the following actions are perform with this list: 1) If the request is adding members to the group and the all flag is set to true, then any person numbers contained in this list will not be added. 2) If the request is removing members from a group and the all flag is set to true, then any person numbers contained in this will remain members of the group.

Collection of integer

None.

Request Formats

application/json, text/json

Sample:
{
  "All": true,
  "Contacts": [
    1,
    2
  ]
}

application/xml, text/xml

Sample:
<GroupMemberRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <All>true</All>
  <Contacts>
    <int>1</int>
    <int>2</int>
  </Contacts>
</GroupMemberRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'System.Web.Http.ModelBinding.JQueryMvcFormUrlEncodedFormatter' to write type 'TwoSms.CustomerPortalRole.API.AddressBooks.GroupMemberRequest'.

Response Information

Resource Description

Status message of the request.

TwoSms.CustomerPortalRole.API.Misc.ResponseOfSystem.Object
NameDescriptionTypeAdditional information
Error

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfSystem.Object

None.

Response Formats

application/json, text/json

Sample:
{
  "Error": {
    "ErrorCode": "sample string 1",
    "ErrorReason": "sample string 2"
  },
  "ResponseData": {
    "Identification": {
      "UserId": "sample string 1"
    },
    "Result": "sample string 1",
    "Detail": {}
  }
}

application/xml, text/xml

Sample:
<ResponseOfObject xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Error>
    <ErrorCode>sample string 1</ErrorCode>
    <ErrorReason>sample string 2</ErrorReason>
  </Error>
  <ResponseData>
    <Result>sample string 1</Result>
    <Identification>
      <UserId>sample string 1</UserId>
    </Identification>
    <Detail />
  </ResponseData>
</ResponseOfObject>