Table Of Contents

Application Packaging Standard

Last updated 18-Mar-2019

Create Service Users

Scenario

In many cases, services (mail boxes, storage, virtual servers, etc.) acquired by a customer must be assigned to service users. In this scenario, you will create one or more services users linked with the customer account created earlier.

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

Source Data

Source data is similar to the data used for creating the staff member, except for the following:

Preliminary Inspection

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

  • Get a list of all service users:

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

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

Creating Object

The APS type used to create a user contains a required relationship with the account. The best way to provision such objects is to follow the Provisioning Resources with Required Links operation. The REST request must require creation of a link on the 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/service-user/1.2"
   },
   "isAccountAdmin": false,
   "login": "na@aps.test",
   "password": "p@$$w0rd",
   "email": "na@aps.test",
   "givenName": "Nick",
   "familyName": "Archer",
   "telVoice": "1(888)1230002",
   "addressPostal": {
      "streetAddress":"12, ISVusers",
      "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/service-user/1.2",
    "id": "e21e19e0-5951-43a7-8103-8c5606398379",
    "status": "aps:ready",
    "revision": 5,
    "modified": "2016-09-27T09:16:30Z",
    "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": "12, ISVusers"
  },
  "disabled": false,
  "displayName": "",
  "email": "an@aps.test",
  "familyName": "Archer",
  "fullName": "",
  "givenName": "Nick",
  "isAccountAdmin": false,
  "locale": "en_US",
  "locked": false,
  "login": "na@aps.test",
  "servicesMode": "NONE",
  "telVoice": "1#888#1230002#",
  "userId": 8,
  "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/e21e19e0-5951-43a7-8103-8c5606398379/services"
    }
  }
}

The same way, you can create more users.

Conclusion

You have successfully created service users.

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 users.