GET api/v1/admin/accounts/{id}/accounts?Name={Name}&MobilePhone={MobilePhone}&EmailAddress={EmailAddress}

This method retrieves all the accounts that the authenticated user is allowed to view. It will return the master account first, followed by all the sub-accounts that the user has been granted access. The sub-accounts are order by the name field. The method will return data only if the authenticated user is authorised to access the accounts, else it will return a HTTP 401 error.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

The parent account.

globally unique identifier

Required

Name

Full name of the sub account

string

None.

MobilePhone

Mobile phone number of the sub account

string

None.

EmailAddress

Email address of the sub account

string

None.

Body Parameters

None.

Response Information

Resource Description

List of accounts that the authenticated user is allowed to view.

TwoSms.CustomerPortalRole.API.Misc.ResponseOfTwoSms.CustomerPortalRole.API.Admin.Accounts.Account[]
NameDescriptionTypeAdditional information
Error

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfTwoSms.CustomerPortalRole.API.Admin.Accounts.Account[]

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": [
      {
        "ID": "cdd7d58d-860c-4dba-b3df-447309144285",
        "AccountID": "a1564efe-68f2-4b06-870e-b5972fccf7b7",
        "Address": "sample string 2",
        "AnyTimeBalance": 1.1,
        "ContactNumber": "sample string 3",
        "PhoneNumber": "sample string 4",
        "DateCreated": "2024-03-28T06:42:20.5586614+00:00",
        "DateModified": "2024-03-28T06:42:20.5586614+00:00",
        "Disclaimer": "sample string 6",
        "EmailAddress": "sample string 8",
        "FirstName": "sample string 10",
        "Defaultheader": "sample string 11",
        "LanguageID": "83e20711-b520-4a7a-867f-7e6468b23b0e",
        "LanguageName": "sample string 13",
        "LastName": "sample string 14",
        "Location": "sample string 15",
        "Logo": "sample string 16",
        "LogoName": "sample string 18",
        "Name": "sample string 19",
        "OffPeakBalance": 1.1,
        "Preferences": [
          0,
          0
        ],
        "SCIMEnabled": true,
        "SMSPassword": "sample string 21",
        "SMSUsername": "sample string 22",
        "TimeZone": "sample string 23",
        "TwoFactorEnabled": true,
        "URL": "sample string 24",
        "Website": "sample string 26"
      },
      {
        "ID": "cdd7d58d-860c-4dba-b3df-447309144285",
        "AccountID": "a1564efe-68f2-4b06-870e-b5972fccf7b7",
        "Address": "sample string 2",
        "AnyTimeBalance": 1.1,
        "ContactNumber": "sample string 3",
        "PhoneNumber": "sample string 4",
        "DateCreated": "2024-03-28T06:42:20.5586614+00:00",
        "DateModified": "2024-03-28T06:42:20.5586614+00:00",
        "Disclaimer": "sample string 6",
        "EmailAddress": "sample string 8",
        "FirstName": "sample string 10",
        "Defaultheader": "sample string 11",
        "LanguageID": "83e20711-b520-4a7a-867f-7e6468b23b0e",
        "LanguageName": "sample string 13",
        "LastName": "sample string 14",
        "Location": "sample string 15",
        "Logo": "sample string 16",
        "LogoName": "sample string 18",
        "Name": "sample string 19",
        "OffPeakBalance": 1.1,
        "Preferences": [
          0,
          0
        ],
        "SCIMEnabled": true,
        "SMSPassword": "sample string 21",
        "SMSUsername": "sample string 22",
        "TimeZone": "sample string 23",
        "TwoFactorEnabled": true,
        "URL": "sample string 24",
        "Website": "sample string 26"
      }
    ]
  }
}

application/xml, text/xml

Sample:
<ResponseOfArrayOfAccount 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>
      <Account>
        <ID>cdd7d58d-860c-4dba-b3df-447309144285</ID>
        <AccountID>a1564efe-68f2-4b06-870e-b5972fccf7b7</AccountID>
        <Address>sample string 2</Address>
        <AnyTimeBalance>1.1</AnyTimeBalance>
        <ContactNumber>sample string 3</ContactNumber>
        <PhoneNumber>sample string 4</PhoneNumber>
        <DateCreated>2024-03-28T06:42:20.5586614+00:00</DateCreated>
        <DateModified>2024-03-28T06:42:20.5586614+00:00</DateModified>
        <Disclaimer>sample string 6</Disclaimer>
        <DisclaimerRemove>true</DisclaimerRemove>
        <EmailAddress>sample string 8</EmailAddress>
        <Enabled>true</Enabled>
        <FirstName>sample string 10</FirstName>
        <Defaultheader>sample string 11</Defaultheader>
        <LanguageID>83e20711-b520-4a7a-867f-7e6468b23b0e</LanguageID>
        <LanguageName>sample string 13</LanguageName>
        <LastName>sample string 14</LastName>
        <Location>sample string 15</Location>
        <Logo>sample string 16</Logo>
        <LogoRemoved>true</LogoRemoved>
        <LogoName>sample string 18</LogoName>
        <Name>sample string 19</Name>
        <OffPeakBalance>1.1</OffPeakBalance>
        <Preferences>
          <AccountPreferences>ALL</AccountPreferences>
          <AccountPreferences>ALL</AccountPreferences>
        </Preferences>
        <SCIMEnabled>true</SCIMEnabled>
        <SMSPassword>sample string 21</SMSPassword>
        <SMSUsername>sample string 22</SMSUsername>
        <TimeZone>sample string 23</TimeZone>
        <TwoFactorEnabled>true</TwoFactorEnabled>
        <URL>sample string 24</URL>
        <Users>
          <AccountUserInfo>
            <UserID>e7657c97-4997-4acc-99dd-7261b777b86d</UserID>
            <Name>sample string 2</Name>
            <PermissionLevel>STANDARD_USER</PermissionLevel>
          </AccountUserInfo>
          <AccountUserInfo>
            <UserID>e7657c97-4997-4acc-99dd-7261b777b86d</UserID>
            <Name>sample string 2</Name>
            <PermissionLevel>STANDARD_USER</PermissionLevel>
          </AccountUserInfo>
        </Users>
        <Validated>true</Validated>
        <Website>sample string 26</Website>
      </Account>
      <Account>
        <ID>cdd7d58d-860c-4dba-b3df-447309144285</ID>
        <AccountID>a1564efe-68f2-4b06-870e-b5972fccf7b7</AccountID>
        <Address>sample string 2</Address>
        <AnyTimeBalance>1.1</AnyTimeBalance>
        <ContactNumber>sample string 3</ContactNumber>
        <PhoneNumber>sample string 4</PhoneNumber>
        <DateCreated>2024-03-28T06:42:20.5586614+00:00</DateCreated>
        <DateModified>2024-03-28T06:42:20.5586614+00:00</DateModified>
        <Disclaimer>sample string 6</Disclaimer>
        <DisclaimerRemove>true</DisclaimerRemove>
        <EmailAddress>sample string 8</EmailAddress>
        <Enabled>true</Enabled>
        <FirstName>sample string 10</FirstName>
        <Defaultheader>sample string 11</Defaultheader>
        <LanguageID>83e20711-b520-4a7a-867f-7e6468b23b0e</LanguageID>
        <LanguageName>sample string 13</LanguageName>
        <LastName>sample string 14</LastName>
        <Location>sample string 15</Location>
        <Logo>sample string 16</Logo>
        <LogoRemoved>true</LogoRemoved>
        <LogoName>sample string 18</LogoName>
        <Name>sample string 19</Name>
        <OffPeakBalance>1.1</OffPeakBalance>
        <Preferences>
          <AccountPreferences>ALL</AccountPreferences>
          <AccountPreferences>ALL</AccountPreferences>
        </Preferences>
        <SCIMEnabled>true</SCIMEnabled>
        <SMSPassword>sample string 21</SMSPassword>
        <SMSUsername>sample string 22</SMSUsername>
        <TimeZone>sample string 23</TimeZone>
        <TwoFactorEnabled>true</TwoFactorEnabled>
        <URL>sample string 24</URL>
        <Users>
          <AccountUserInfo>
            <UserID>e7657c97-4997-4acc-99dd-7261b777b86d</UserID>
            <Name>sample string 2</Name>
            <PermissionLevel>STANDARD_USER</PermissionLevel>
          </AccountUserInfo>
          <AccountUserInfo>
            <UserID>e7657c97-4997-4acc-99dd-7261b777b86d</UserID>
            <Name>sample string 2</Name>
            <PermissionLevel>STANDARD_USER</PermissionLevel>
          </AccountUserInfo>
        </Users>
        <Validated>true</Validated>
        <Website>sample string 26</Website>
      </Account>
    </Detail>
  </ResponseData>
</ResponseOfArrayOfAccount>