PAAdminUser

This type represents an administrative user.

GraphViz

Schema

The considered APS type (download) extends the PAUser, AdminUser APS type(s) and looks as follows:

{
  "name": "PAAdminUser",
  "id": "http://parallels.com/aps/types/pa/admin-user/1.2",
  "apsVersion": "2.0",
  "implements": [
    "http://parallels.com/aps/types/pa/user/1.2",
    "http://aps-standard.org/types/core/admin-user/1.0"
  ],
  "operations": {
    "modifyAllowedOperations": {
      "path": "allowedOperations",
      "verb": "PUT",
      "errorResponse": {
        "type": "object"
      },
      "access": {
        "owner": false,
        "referrer": true
      },
      "parameters": {
        "modifications": {
          "kind": "body",
          "type": "AllowedOperationsModification"
        }
      }
    },
    "listAllowedOperation": {
      "path": "allowedOperations",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "AllowedOperation"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "access": {
        "owner": false,
        "referrer": true
      }
    }
  },
  "structures": {
    "AllowedOperation": {
      "type": "object",
      "properties": {
        "apsType": {
          "type": "string"
        },
        "method": {
          "type": "string",
          "enum": [
            "GET",
            "POST",
            "PUT",
            "DELETE"
          ]
        }
      }
    },
    "AllowedOperationsModification": {
      "type": "object",
      "properties": {
        "toAdd": {
          "type": "array",
          "items": {
            "type": "AllowedOperation"
          }
        },
        "toRemove": {
          "type": "array",
          "items": {
            "type": "AllowedOperation"
          }
        }
      }
    }
  }
}

The APS type is used to manage a collection of APS resources. To get a list of resources from that collection, use the following API call:

GET  /aps/2/collections/pa-admin-users?<RQL-filter>

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

modifyAllowedOperations

PUT

/allowedOperations

If successful, this method returns the 200 OK standard status code.

Add or remove allowed operations for APS Applications using oAuth1.0a or oAuth2.0 credentials

listAllowedOperation

GET

/allowedOperations

If successful, this method returns a list of allowed operations for API calls oAuth1.0a and oAuth2.0

Get list of allowed operations for APS Applications using oAuth1.0a or oAuth2.0 credentials

modifyAllowedOperations

HTTP Request

PUT /aps/2/resources/{aps-id}/allowedOperations

Description

Add or remove allowed operations for APS Applications using oAuth1.0a or oAuth2.0 credentials

Parameters

PARAMETER

TYPE

DESCRIPTION

modifications

AllowedOperationsModification

Returns

If successful, this method returns the 200 OK standard status code.

listAllowedOperation

HTTP Request

GET /aps/2/resources/{aps-id}/allowedOperations

Description

Get list of allowed operations for APS Applications using oAuth1.0a or oAuth2.0 credentials

Returns

If successful, this method returns a list of allowed operations for API calls oAuth1.0a and oAuth2.0

Structures

AllowedOperation

Structure represents allowed operation to access from API

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

apsType

String

Not Required

APS Type to call operations

method

Enum

Not Required

HTTP verb to allow
HTTP verb for allowed operations

AllowedOperationsModification

A list of modifications of allowed operations to access from API

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

toAdd

Array of AllowedOperation

Not Required

A list of operations to add

toRemove

Array of AllowedOperation

Not Required

A list of operations to remove

Examples

Get all Staff Members

GET /aps/2/collections/admin-users

Create Staff Member

The APS type used to create a staff member contains a required relationship with the account. One of the ways to provision such objects is to follow the Provisioning Resources with Required Links operation. The REST request specifies the customer APS ID in the URL to create a link to the customer’s users collection along with creation of the user to whom the link leads to:

POST /aps/2/resources/6344049b-8763-417d-837b-490ba0896f41/users/

{
   "aps": {
      "type": "http://parallels.com/aps/types/pa/admin-user/1.2"
   },
   "isAccountAdmin": true,
   "login": "mw@aps.test",
   "password": "p@$$w0rd",
   "email": "mw@aps.test",
   "givenName": "Mike",
   "familyName": "Wilson",
   "telVoice": "1(888)1234567",
   "addressPostal": {
      "streetAddress":"11, ISVone",
      "locality":"Herndon",
      "region":"VA",
      "countryName":"us",
      "postalCode":"12345"
   }
}

The response must look similar to:

HTTP/1.1 200 OK

{
   "aps": {
      "type": "http://parallels.com/aps/types/pa/admin-user/1.2",
      "id": "1c8763a4-ed0e-470b-a24e-4e05c7efb61e",
      "status": "aps:ready",
      "revision": 4,
      "modified": "2016-09-27T08:11:34Z",
      "package": {
         "id": "e86ef200-5751-4c2c-b342-e65483ede6d0",
         "href": "/aps/2/packages/e86ef200-5751-4c2c-b342-e65483ede6d0"
      }
   },
   "addressPostal": {
      "countryName": "us",
      "locality": "Herndon",
      "postalCode": "12345",
      "region": "VA",
      "streetAddress": "11, ISVone"
   },
   "disabled": false,
   "displayName": "",
   "email": "mw@aps.test",
   "familyName": "Wilson",
   "fullName": "",
   "givenName": "Mike",
   "isAccountAdmin": true,
   "locale": "en_US",
   "locked": false,
   "login": "mw@aps.test",
   "memberId": 6,
   "servicesMode": "NONE",
   "telVoice": "1#888#1234567#",
   "userId": 6,
   "organization": {
      "aps": {
         "link": "strong",
         "href": "/aps/2/resources/6344049b-8763-417d-837b-490ba0896f41",
         "id": "6344049b-8763-417d-837b-490ba0896f41"
      }
   },
   "services": {
      "aps": {
         "link": "collection",
         "href": "/aps/2/resources/1c8763a4-ed0e-470b-a24e-4e05c7efb61e/services"
      }
   }
}

Configure User

The following example illustrates how to change the phone number and postal address:

PUT /aps/2/resources/583f9d71-0e0b-4f65-8e76-56089de9378e

{
   "telCell": "+1 888 345-1234",
   "addressPostal": {
      "streetAddress":"88, ISV users",
      "locality":"Herndon",
      "region":"VA",
      "countryName":"US",
      "postalCode":"54387"
   }
}

In case of success, the return code must be “200 OK” and the returned payload contains the JSON representation of the updated user resource.

Remove User

Sometimes it is necessary to remove a user resource from the platform, for example, when the represented user leaves a company registered in the platform. The respective request looks as follows:

DELETE /aps/2/resources/583f9d71-0e0b-4f65-8e76-56089de9378e

In case of success, the return code must be “204 No content”.