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.

ResponseOfAccount[]
NameDescriptionTypeAdditional information
Error

Error

None.

ResponseData

ResponseDataOfAccount[]

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": "76cdf45f-1ccd-49cc-81c3-67c6a93a4fcf",
        "AccountID": "985b7b16-b7de-40d7-b2f7-972543585e1a",
        "Address": "sample string 2",
        "AnyTimeBalance": 1.1,
        "ContactNumber": "sample string 3",
        "DateCreated": "2018-08-21T09:32:36.4433384+01:00",
        "DateModified": "2018-08-21T09:32:36.4433384+01:00",
        "Disclaimer": "sample string 5",
        "EmailAddress": "sample string 6",
        "FirstName": "sample string 8",
        "LanguageID": "fb1736fb-5cbd-4929-99b5-8fdffd08a488",
        "LanguageName": "sample string 10",
        "LastName": "sample string 11",
        "Location": "sample string 12",
        "Logo": "sample string 13",
        "LogoName": "sample string 14",
        "Name": "sample string 15",
        "OffPeakBalance": 1.1,
        "Preferences": [
          0,
          0
        ],
        "SMSPassword": "sample string 16",
        "SMSUsername": "sample string 17",
        "TimeZone": "sample string 18",
        "TwoFactorEnabled": true,
        "URL": "sample string 19",
        "Website": "sample string 21"
      },
      {
        "ID": "76cdf45f-1ccd-49cc-81c3-67c6a93a4fcf",
        "AccountID": "985b7b16-b7de-40d7-b2f7-972543585e1a",
        "Address": "sample string 2",
        "AnyTimeBalance": 1.1,
        "ContactNumber": "sample string 3",
        "DateCreated": "2018-08-21T09:32:36.4433384+01:00",
        "DateModified": "2018-08-21T09:32:36.4433384+01:00",
        "Disclaimer": "sample string 5",
        "EmailAddress": "sample string 6",
        "FirstName": "sample string 8",
        "LanguageID": "fb1736fb-5cbd-4929-99b5-8fdffd08a488",
        "LanguageName": "sample string 10",
        "LastName": "sample string 11",
        "Location": "sample string 12",
        "Logo": "sample string 13",
        "LogoName": "sample string 14",
        "Name": "sample string 15",
        "OffPeakBalance": 1.1,
        "Preferences": [
          0,
          0
        ],
        "SMSPassword": "sample string 16",
        "SMSUsername": "sample string 17",
        "TimeZone": "sample string 18",
        "TwoFactorEnabled": true,
        "URL": "sample string 19",
        "Website": "sample string 21"
      }
    ]
  }
}

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>76cdf45f-1ccd-49cc-81c3-67c6a93a4fcf</ID>
        <AccountID>985b7b16-b7de-40d7-b2f7-972543585e1a</AccountID>
        <Address>sample string 2</Address>
        <AnyTimeBalance>1.1</AnyTimeBalance>
        <ContactNumber>sample string 3</ContactNumber>
        <DateCreated>2018-08-21T09:32:36.4433384+01:00</DateCreated>
        <DateModified>2018-08-21T09:32:36.4433384+01:00</DateModified>
        <Disclaimer>sample string 5</Disclaimer>
        <EmailAddress>sample string 6</EmailAddress>
        <Enabled>true</Enabled>
        <FirstName>sample string 8</FirstName>
        <LanguageID>fb1736fb-5cbd-4929-99b5-8fdffd08a488</LanguageID>
        <LanguageName>sample string 10</LanguageName>
        <LastName>sample string 11</LastName>
        <Location>sample string 12</Location>
        <Logo>sample string 13</Logo>
        <LogoName>sample string 14</LogoName>
        <Name>sample string 15</Name>
        <OffPeakBalance>1.1</OffPeakBalance>
        <Preferences>
          <AccountPreferences>ALL</AccountPreferences>
          <AccountPreferences>ALL</AccountPreferences>
        </Preferences>
        <SMSPassword>sample string 16</SMSPassword>
        <SMSUsername>sample string 17</SMSUsername>
        <TimeZone>sample string 18</TimeZone>
        <TwoFactorEnabled>true</TwoFactorEnabled>
        <URL>sample string 19</URL>
        <Users>
          <AccountUserInfo>
            <UserID>67eb003c-60cc-447c-bf78-6701fb9d60c5</UserID>
            <Name>sample string 2</Name>
            <PermissionLevel>STANDARD_USER</PermissionLevel>
          </AccountUserInfo>
          <AccountUserInfo>
            <UserID>67eb003c-60cc-447c-bf78-6701fb9d60c5</UserID>
            <Name>sample string 2</Name>
            <PermissionLevel>STANDARD_USER</PermissionLevel>
          </AccountUserInfo>
        </Users>
        <Validated>true</Validated>
        <Website>sample string 21</Website>
      </Account>
      <Account>
        <ID>76cdf45f-1ccd-49cc-81c3-67c6a93a4fcf</ID>
        <AccountID>985b7b16-b7de-40d7-b2f7-972543585e1a</AccountID>
        <Address>sample string 2</Address>
        <AnyTimeBalance>1.1</AnyTimeBalance>
        <ContactNumber>sample string 3</ContactNumber>
        <DateCreated>2018-08-21T09:32:36.4433384+01:00</DateCreated>
        <DateModified>2018-08-21T09:32:36.4433384+01:00</DateModified>
        <Disclaimer>sample string 5</Disclaimer>
        <EmailAddress>sample string 6</EmailAddress>
        <Enabled>true</Enabled>
        <FirstName>sample string 8</FirstName>
        <LanguageID>fb1736fb-5cbd-4929-99b5-8fdffd08a488</LanguageID>
        <LanguageName>sample string 10</LanguageName>
        <LastName>sample string 11</LastName>
        <Location>sample string 12</Location>
        <Logo>sample string 13</Logo>
        <LogoName>sample string 14</LogoName>
        <Name>sample string 15</Name>
        <OffPeakBalance>1.1</OffPeakBalance>
        <Preferences>
          <AccountPreferences>ALL</AccountPreferences>
          <AccountPreferences>ALL</AccountPreferences>
        </Preferences>
        <SMSPassword>sample string 16</SMSPassword>
        <SMSUsername>sample string 17</SMSUsername>
        <TimeZone>sample string 18</TimeZone>
        <TwoFactorEnabled>true</TwoFactorEnabled>
        <URL>sample string 19</URL>
        <Users>
          <AccountUserInfo>
            <UserID>67eb003c-60cc-447c-bf78-6701fb9d60c5</UserID>
            <Name>sample string 2</Name>
            <PermissionLevel>STANDARD_USER</PermissionLevel>
          </AccountUserInfo>
          <AccountUserInfo>
            <UserID>67eb003c-60cc-447c-bf78-6701fb9d60c5</UserID>
            <Name>sample string 2</Name>
            <PermissionLevel>STANDARD_USER</PermissionLevel>
          </AccountUserInfo>
        </Users>
        <Validated>true</Validated>
        <Website>sample string 21</Website>
      </Account>
    </Detail>
  </ResponseData>
</ResponseOfArrayOfAccount>