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

Adds a sub account access to the current user.

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

The ID of the user

globally unique identifier

Required

Body Parameters

The account and access level to be given to the user.

TwoSms.CustomerPortalRole.API.Admin.Users.UserAccount
NameDescriptionTypeAdditional information
AccountID

The account the user has access to.

globally unique identifier

None.

AccessLevel

The access level for the user.

TwoSms.Platform.Database.CustomerPortal.Tables.Accounts.UserPermissions

None.

Request Formats

application/json, text/json

Sample:
{
  "AccountID": "ea691e9f-f9b5-49c3-9d1a-68301489073e",
  "AccessLevel": 0
}

application/xml, text/xml

Sample:
<UserAccount xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <AccountID>ea691e9f-f9b5-49c3-9d1a-68301489073e</AccountID>
  <AccessLevel>STANDARD_USER</AccessLevel>
</UserAccount>

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.Users.UserAccount'.

Response Information

Resource Description

TwoSms.CustomerPortalRole.API.Misc.ResponseOfSystem.Object
NameDescriptionTypeAdditional information
Error

TwoSms.CustomerPortalRole.API.Misc.Error

None.

ResponseData

TwoSms.CustomerPortalRole.API.Misc.ResponseDataOfSystem.Object

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": {}
  }
}

application/xml, text/xml

Sample:
<ResponseOfObject 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 />
  </ResponseData>
</ResponseOfObject>