POST api/v1/admin/accounts/{id}

This api method creates a subaccount for your account. You need to pass in all the relevant details together with the master account id. A good amount of validation is added, so make sure that you follow the criteria for each of the attributes.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

Account id of the master account. To be able to link the master with the sub account.

globally unique identifier

Required

Body Parameters

The details of the new account.

TwoSms.CustomerPortalRole.API.Admin.Accounts.AccountRequest
NameDescriptionTypeAdditional information
Address

The company's address for billing purposes.

string

None.

CompanyName

Company name the account is working for

string

None.

Email

Contact Email address of the account

string

Required

Username

Username of the account

string

Required

Firstname

Firstname of the account

string

Required

LanguageID

The account language.

globally unique identifier

None.

Lastname

Lastname of the account

string

Required

MobilePhone

Mobile number of the account

string

None.

Password

Password of the account

string

Required

TimeZone

The Time zone the account.

string

None.

WebSite

The website of the account.

string

None.

Request Formats

application/json, text/json

Sample:
{
  "Address": "sample string 1",
  "CompanyName": "sample string 2",
  "Email": "sample string 3",
  "Username": "sample string 4",
  "Firstname": "sample string 5",
  "LanguageID": "3b5abdb7-7989-45df-ba6a-9b9e08f76faa",
  "Lastname": "sample string 6",
  "MobilePhone": "sample string 7",
  "Password": "sample string 8",
  "TimeZone": "sample string 9",
  "TimeZoneInJavaFormat": "sample string 10",
  "WebSite": "sample string 11"
}

application/xml, text/xml

Sample:
<AccountRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Address>sample string 1</Address>
  <CompanyName>sample string 2</CompanyName>
  <Email>sample string 3</Email>
  <Username>sample string 4</Username>
  <Firstname>sample string 5</Firstname>
  <LanguageID>3b5abdb7-7989-45df-ba6a-9b9e08f76faa</LanguageID>
  <Lastname>sample string 6</Lastname>
  <MobilePhone>sample string 7</MobilePhone>
  <Password>sample string 8</Password>
  <TimeZone>sample string 9</TimeZone>
  <TimeZoneInJavaFormat>sample string 10</TimeZoneInJavaFormat>
  <WebSite>sample string 11</WebSite>
</AccountRequest>

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.Admin.Accounts.AccountRequest'.

Response Information

Resource Description

TwoSms.CustomerPortalRole.API.Misc.ResponseOfTwoSms.CustomerPortalRole.API.Admin.Accounts.AccountResponse
NameDescriptionTypeAdditional information
Error

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfTwoSms.CustomerPortalRole.API.Admin.Accounts.AccountResponse

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": "fcf80b4d-f12f-413c-8294-ff433a9fbfa0"
    }
  }
}

application/xml, text/xml

Sample:
<ResponseOfAccountResponse 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>
      <ID>fcf80b4d-f12f-413c-8294-ff433a9fbfa0</ID>
    </Detail>
  </ResponseData>
</ResponseOfAccountResponse>