Table Of Contents

Application Packaging Standard

Last updated 18-Mar-2019

Create Staff Member

Scenario

The customer created in the previous scenario, needs an administrator who will manage the subscribed services and billing objects.

../../../_images/sys-user-step-customer.png ../../../_images/sys-user-step-staff-b.png ../../../_images/sys-user-step-user.png ../../../_images/sys-user-step-subscription.png ../../../_images/sys-user-step-service.png

Source Data

You need to collect the following data:

  • Security token - the same provider admin’s token as used in the previous scenario.

  • APS ID assigned to the new customer created in the previous scenario. You will link the customer with the new staff member using the users relationship collection in the standard PAAccount type.

    If you don’t have the customer APS ID in a buffer, use one of the methods in the previous scenario to get it.

  • APS type - to create a staff member, use the PAAdminUser type from the OSS Types.

  • Set of properties - the following table illustrates a list of properties required for creation of a staff member.

Property Type Sample value Notes
aps.type URI http://parallels.com/aps/types/pa/admin-user/1.2 Exact match with the ID specified in PAAccount.
isAccountAdmin Boolean true The user must be granted the administrative privileges.
login Mail address mw@aps.test Unique login name in the form of email address.
password String p@$$w0rd A password compliant with the password strength policy as configured in PCP.
email String isv1@aps.test  
givenName String “Mike”  
familyName String “Wilson”  
telVoice String “1(888)1234567”  
addressPostal Structure {“streetAddress”:”11, ISVone”, “locality”:”Herndon”, “region”:”VA”, “countryName”:”us”, “postalCode”:”12345”} Enter full postal address as specified by the http://aps-standard.org/types/core/contact/1.1#Address structure in the standard Contact type.

Note

Contact properties of the user, declared in the inherited standard Contact type, are the same as specified in the customer contacts.

The login and password properties are declared in the inherited standard User type.

The following table illustrates the relationship required for creating a new staff member.

RELATION APS type on the remote end Notes
organization http://aps-standard.org/types/core/account/1.0 Required relationship.

Preliminary Inspection

Before you start creating a new user, verify if there is a user with similar properties.

  • Get a list of all staff members:

    GET /aps/2/resources?implementing(http://parallels.com/aps/types/pa/admin-user/1.2)
    
  • Verify if there is a user with the email address belonging to the new staff member:

    GET /aps/2/resources?implementing(http://parallels.com/aps/types/pa/user/1.2),eq(email,isv1@aps.test)
    

Creating Object

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 its URI to create a link on the customer’s users collection along with creation of the user to whom the link leads to:

POST /aps/2/resources/e489cb96-e988-475a-854b-0d0a67a18aed/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"
   },
   "organization": {
      "aps": {
         "link": "strong",
         "href": "aps/2/resources/e489cb96-e988-475a-854b-0d0a67a18aed",
         "id": "e489cb96-e988-475a-854b-0d0a67a18aed"
      }
   }
}

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/e489cb96-e988-475a-854b-0d0a67a18aed",
      "id": "e489cb96-e988-475a-854b-0d0a67a18aed"
    }
  },
  "services": {
    "aps": {
      "link": "collection",
      "href": "/aps/2/resources/1c8763a4-ed0e-470b-a24e-4e05c7efb61e/services"
    }
  }
}

Conclusion

You have successfully created a customer administrator. This user has permissions for all activities on behalf of the customer account.

You can use additional verification of the user existence:

  • Use the REST requests described in the Preliminary Inspection to find the difference.
  • Find the new customers in the provider control panel (PCP). For this aim, log in to PCP and navigate to System > Users to get a list of all users. Use filters and sort the list by columns to identify the new user.