GET api/v3/addressbook/contacts?paging.Page={paging.Page}&paging.NoOfRecords={paging.NoOfRecords}&Inheritance={Inheritance}&sort.Field={sort.Field}&sort.Direction={sort.Direction}

This method returns a list of all the contacts stored on the customer’s account if no parameters are provided. For each contact it will include their first name, last name, mobile number, email address and the type of authentication the contact has chosen if used with an SMS+ message. This method allows the list to be page for large address books and filtered to reduce the size of the data returned.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
AddressBookGroupID

Allows to restrict all contacts that belong to a certain group.

globally unique identifier

None.

EmailAddress

Email address of the person in addressbook

string

None.

FirstName

First name of the person in addressbook

string

None.

LastName

Last name of the person in addressbook

string

None.

MobilePhone

Comma delimited list of mobile numbers to search for in the addressbook

string

None.

PersonNumbers

List all the person numbers to display the contact details.

Collection of integer

None.

Page

The Page number for the report.

integer

Required

NoOfRecords

The number of records to return per page.

integer

Required

Inheritance

Flag to include all inherited contacts. Setting to false will result in only account owned contacts (Default : true)

boolean

Default value is True

Field

The field to be sorted.

TwoSms.CustomerPortalRole.API.AddressBooks.ContactField

None.

Direction

Ascending or Descending order

TwoSms.CustomerPortalRole.API.AddressBooks.Direction

None.

Body Parameters

None.

Response Information

Resource Description

List of contacts of the authenticated user.

TwoSms.CustomerPortalRole.API.Misc.ResponseOfTwoSms.CustomerPortalRole.API.AddressBooks.AddressBookResponseV2
NameDescriptionTypeAdditional information
Error

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfTwoSms.CustomerPortalRole.API.AddressBooks.AddressBookResponseV2

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": {
      "Contacts": [
        {
          "PersonNumber": 3,
          "DateCreated": "2020-11-23T16:18:13.2928209+00:00",
          "DateModified": "2020-11-23T16:18:13.2928209+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": "40abf74e-329f-48db-b6db-852b6371adc0",
          "Password": "sample string 10",
          "PermissionLevel": 0,
          "Validated": true
        },
        {
          "PersonNumber": 3,
          "DateCreated": "2020-11-23T16:18:13.2928209+00:00",
          "DateModified": "2020-11-23T16:18:13.2928209+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": "40abf74e-329f-48db-b6db-852b6371adc0",
          "Password": "sample string 10",
          "PermissionLevel": 0,
          "Validated": true
        }
      ],
      "ContactsCount": 1
    }
  }
}

application/xml, text/xml

Sample:
<ResponseOfAddressBookResponseV2 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>
      <Contacts>
        <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>2020-11-23T16:18:13.2928209+00:00</DateCreated>
          <DateModified>2020-11-23T16:18:13.2928209+00:00</DateModified>
          <LastModifiedBy>sample string 4</LastModifiedBy>
          <OwnerAccountID>40abf74e-329f-48db-b6db-852b6371adc0</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>2020-11-23T16:18:13.2928209+00:00</DateCreated>
          <DateModified>2020-11-23T16:18:13.2928209+00:00</DateModified>
          <LastModifiedBy>sample string 4</LastModifiedBy>
          <OwnerAccountID>40abf74e-329f-48db-b6db-852b6371adc0</OwnerAccountID>
          <Inherited>true</Inherited>
          <PermissionLevel>NONE</PermissionLevel>
          <Groups>sample string 2</Groups>
        </AddressBookResponse>
      </Contacts>
      <ContactsCount>1</ContactsCount>
    </Detail>
  </ResponseData>
</ResponseOfAddressBookResponseV2>