POST api/v4/addressbook/contacts

This method adds multiple contacts to the system. The system checks that the mobile numbers and email address are valid and if the validation is requested, the system will send a message to the contact to check the details are correct.

Request Information

URI Parameters

None.

Body Parameters

Either xml or json request.

TwoSms.CustomerPortalRole.API.AddressBooks.AddressBookLiteV2
NameDescriptionTypeAdditional information
GroupID

globally unique identifier

None.

contacts

Collection of TwoSms.CustomerPortalRole.API.AddressBooks.AddressBookLite

None.

Request Formats

application/json, text/json

Sample:
{
  "contacts": [
    {
      "EmailAddress": "sample string 7",
      "FirstName": "sample string 4",
      "LastName": "sample string 5",
      "MobilePhone": "sample string 6",
      "LoginType": 9,
      "Password": "sample string 8",
      "Validated": true
    },
    {
      "EmailAddress": "sample string 7",
      "FirstName": "sample string 4",
      "LastName": "sample string 5",
      "MobilePhone": "sample string 6",
      "LoginType": 9,
      "Password": "sample string 8",
      "Validated": true
    }
  ],
  "GroupID": "903d07dc-8747-4c69-a621-f9cd5efaf7ea"
}

application/xml, text/xml

Sample:
<AddressBookLiteV2 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <contacts>
    <AddressBookLite>
      <FirstName>sample string 4</FirstName>
      <LastName>sample string 5</LastName>
      <MobilePhone>sample string 6</MobilePhone>
      <EmailAddress>sample string 7</EmailAddress>
      <Password>sample string 8</Password>
      <LoginType>9</LoginType>
      <Validated>true</Validated>
      <PersonNumber>1</PersonNumber>
      <DateCreated>2024-04-26T09:37:50.9257541+00:00</DateCreated>
      <DateModified>2024-04-26T09:37:50.9257541+00:00</DateModified>
      <LastModifiedBy>sample string 2</LastModifiedBy>
      <OwnerAccountID>de189a74-33e4-46c1-a999-92700add8f3c</OwnerAccountID>
      <LegacyPersonNumber>1</LegacyPersonNumber>
    </AddressBookLite>
    <AddressBookLite>
      <FirstName>sample string 4</FirstName>
      <LastName>sample string 5</LastName>
      <MobilePhone>sample string 6</MobilePhone>
      <EmailAddress>sample string 7</EmailAddress>
      <Password>sample string 8</Password>
      <LoginType>9</LoginType>
      <Validated>true</Validated>
      <PersonNumber>1</PersonNumber>
      <DateCreated>2024-04-26T09:37:50.9257541+00:00</DateCreated>
      <DateModified>2024-04-26T09:37:50.9257541+00:00</DateModified>
      <LastModifiedBy>sample string 2</LastModifiedBy>
      <OwnerAccountID>de189a74-33e4-46c1-a999-92700add8f3c</OwnerAccountID>
      <LegacyPersonNumber>1</LegacyPersonNumber>
    </AddressBookLite>
  </contacts>
  <GroupID>903d07dc-8747-4c69-a621-f9cd5efaf7ea</GroupID>
</AddressBookLiteV2>

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.AddressBookLiteV2'.

Response Information

Resource Description

Details of the last contact that has been created.

TwoSms.CustomerPortalRole.API.Misc.ResponseOfSystem.Collections.Generic.ListOfTwoSms.CustomerPortalRole.API.AddressBooks.AddressBookResponse
NameDescriptionTypeAdditional information
Error

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfSystem.Collections.Generic.ListOfTwoSms.CustomerPortalRole.API.AddressBooks.AddressBookResponse

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": [
      {
        "PersonNumber": 3,
        "DateCreated": "2024-04-26T09:37:50.9314412+00:00",
        "DateModified": "2024-04-26T09:37:50.9314412+00:00",
        "EmailAddress": "sample string 9",
        "FirstName": "sample string 6",
        "Groups": "sample string 2",
        "Inherited": true,
        "LastName": "sample string 7",
        "LastModifiedBy": "sample string 4",
        "MobilePhone": "sample string 8",
        "LoginType": 11,
        "OwnerAccountID": "daeba4ce-1a54-4c2c-8dee-682e20d235db",
        "Password": "sample string 10",
        "PermissionLevel": 0,
        "Validated": true
      },
      {
        "PersonNumber": 3,
        "DateCreated": "2024-04-26T09:37:50.9314412+00:00",
        "DateModified": "2024-04-26T09:37:50.9314412+00:00",
        "EmailAddress": "sample string 9",
        "FirstName": "sample string 6",
        "Groups": "sample string 2",
        "Inherited": true,
        "LastName": "sample string 7",
        "LastModifiedBy": "sample string 4",
        "MobilePhone": "sample string 8",
        "LoginType": 11,
        "OwnerAccountID": "daeba4ce-1a54-4c2c-8dee-682e20d235db",
        "Password": "sample string 10",
        "PermissionLevel": 0,
        "Validated": true
      }
    ]
  }
}

application/xml, text/xml

Sample:
<ResponseOfListOfAddressBookResponse 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>
      <AddressBookResponse>
        <FirstName>sample string 6</FirstName>
        <LastName>sample string 7</LastName>
        <MobilePhone>sample string 8</MobilePhone>
        <EmailAddress>sample string 9</EmailAddress>
        <Password>sample string 10</Password>
        <LoginType>11</LoginType>
        <Validated>true</Validated>
        <PersonNumber>3</PersonNumber>
        <DateCreated>2024-04-26T09:37:50.9314412+00:00</DateCreated>
        <DateModified>2024-04-26T09:37:50.9314412+00:00</DateModified>
        <LastModifiedBy>sample string 4</LastModifiedBy>
        <OwnerAccountID>daeba4ce-1a54-4c2c-8dee-682e20d235db</OwnerAccountID>
        <Inherited>true</Inherited>
        <PermissionLevel>NONE</PermissionLevel>
        <Groups>sample string 2</Groups>
      </AddressBookResponse>
      <AddressBookResponse>
        <FirstName>sample string 6</FirstName>
        <LastName>sample string 7</LastName>
        <MobilePhone>sample string 8</MobilePhone>
        <EmailAddress>sample string 9</EmailAddress>
        <Password>sample string 10</Password>
        <LoginType>11</LoginType>
        <Validated>true</Validated>
        <PersonNumber>3</PersonNumber>
        <DateCreated>2024-04-26T09:37:50.9314412+00:00</DateCreated>
        <DateModified>2024-04-26T09:37:50.9314412+00:00</DateModified>
        <LastModifiedBy>sample string 4</LastModifiedBy>
        <OwnerAccountID>daeba4ce-1a54-4c2c-8dee-682e20d235db</OwnerAccountID>
        <Inherited>true</Inherited>
        <PermissionLevel>NONE</PermissionLevel>
        <Groups>sample string 2</Groups>
      </AddressBookResponse>
    </Detail>
  </ResponseData>
</ResponseOfListOfAddressBookResponse>