User Management Endpoints

This page contains a list of endpoints for the management of Office 365 end users from the workspace section of the Storefront. Customers and resellers can use the Office 365 User Management capability of the Storefront to assign and de-assign licenses to their end-users, as well as monitor those licenses.

User Management

Add User

Swagger documentation: POST ​/api​/Users​/Add
The purpose of this endpoint is to create a user account in the external system.

Request

{
  "Customer": {
    "ID": "customer_1",
    "AccountID": "1",
    "IsTest": true
  },
  "FirstName": "Test",
  "LastName": "User",
  "Email": "[email protected]",
  "Password": "{Password}"
}
  • Customer – Contains the customer object with the fields listed below:
    • ID – The unique identifier of the user
    • AccountID – The unique identifier of the account
    • IsTest – Determines whether the request was made for testing purposes
  • FirstName – The first name of the user
  • LastName – The last name of the user
  • DisplayName – The name chosen by the user which they are displayed by
  • Username – The username of the customer’s user

Response

{
  "Code": 0,
  "Message": "User created successfully",
  "Result": "3cf8b914-1b4b-4a60-9ae2-ef00b1c710d4"
}

The response is generic and contains the following fields:

  • Code – The error code. A value of 0 for this field means that the request was successful.
  • Message – The error message, if applicable.
  • Result – The ID of the user in the third-party system

User created successfully

When the Endpoint is Called

The endpoint is called when a user is created in the system.

Update User

Swagger documentation: POST ​/api​/Users​/Update
The purpose of this endpoint is to update the details of a user in the external system.

Request

{
	"ID": "user_1",
	"Customer": {
		"ID": "customer_1",
		"AccountID": "1",
		"IsTest": true
	},
	"FirstName": "Test",
	"LastName": "Example",
	"Email": "[email protected]"
}

Email – the customer’s email address.

Otherwise contains the same fields as the request body of the Create User endpoint.

Response

{
  "Code": 0,
  "Message": "User updated successfully",
  "Result": "user_1"
}

The response is generic and contains the same fields as the Create User endpoint.

When the Endpoint is Called

Immediately after the Update option is selected to save a user’s details.

Provision/Deprovision User

Swagger documentation: POST​ /api​/Users​/Provision & POST​ /api​/Users​/DeProvision
The purpose of these endpoints is to provision or deprovision a user respectively.

To begin provisioning/de-provisioning operations, select Manage Licenses in the Users List view.

Note that both endpoints have the same generic fields in the request and response:

Request

{
  "ID": "user_1",
  "Customer": {
    "ID": "customer_1",
    "AccountID": "1",
    "IsTest": true
  }
}

Response

{
  "Code": 0,
  "Message": "User provisioned successfully",
  "Result": "user_1"
}

When the Endpoint is Called

  • The Provision User endpoint is called when a service is assigned to a user.
  • The Deprovision User endpoint is called when an assigned service is revoked.

Activate/Disable User

Swagger documentation: POST​ /api​/Users​/Activate & POST ​/api​/Users​/Disable
The purpose of these endpoints is to activate or disable a user in the external system respectively.

Request

{
	"ID": "user_1",
	"Customer": {
		"ID": "customer_1",
		"AccountID": "1",
		"IsTest": true
	}
}

Response

{
  "Code": 0,
  "Message": "User activated successfully",
  "Result": "user_1"
}

When the Endpoint is Called

The Activate/Disable User endpoints are called when a user is active or disabled respectively.

Get User Details

Swagger documentation: POST ​/api​/Users​/Get
The purpose of this endpoint is to retrieve the details of a user from the external system.

Request

{
	"ID": "user_1",
	"Customer": {
		"ID": "customer_1",
		"AccountID": "1",
		"IsTest": true
	}
}

Response

{
  "ID": "user_1",
  "Customer": {
    "ID": "customer_1",
    "AccountID": "1",
    "Name": null,
    "IsTest": true
  },
  "FirstName": "John",
  "LastName": "Doe",
  "DisplayName": "John Doe",
  "Username": "john.doe",
  "Email": "[email protected]",
  "Password": null,
  "Status": 0,
  "Role": null,
  "PercentageCompleted": null,
  "TotalServices": 3,
  "SecondaryEmail": "[email protected]"
}

Contains the same fields as the request body of the Create User endpoint, with the addition of the following fields:

  • Status – Shows whether the user is Active or Disabled
  • Role – The role (e.g. Administrator) in the system assigned to the user.
  • TotalServices – The total amount of services provisioned for the user.

When the Endpoint is Called

The endpoint is called when

Get Customer Users List

Swagger documentation: POST​ /api​/Users​/Get​/List
The purpose of this endpoint is to retrieve the list of users of a customer from the external system.

Request

{
  "CustomerID": "customer_1",
  "SearchText": "User",
  "PageID": 0,
  "PageSize": 0,
  "IsTest": true
}

In addition to the generic fields described above, contains:

  • SearchText – The search string
  • PageID – The ID of the page containing the search results
  • PageSize – Shows the number of users per page

Response

{
  "Users": [
    {
      "ID": "user_1",
      "Customer": null,
      "FirstName": null,
      "LastName": null,
      "DisplayName": null,
      "Username": null,
      "Email": null,
      "Password": null,
      "Status": null,
      "Role": null,
      "PercentageCompleted": null,
      "TotalServices": null,
      "SecondaryEmail": null
    },
    {
      "ID": "user_2",
      "Customer": null,
      "FirstName": null,
      "LastName": null,
      "DisplayName": null,
      "Username": null,
      "Email": null,
      "Password": null,
      "Status": null,
      "Role": null,
      "PercentageCompleted": null,
      "TotalServices": null,
      "SecondaryEmail": null
    },
    {
      "ID": "user_3",
      "Customer": null,
      "FirstName": null,
      "LastName": null,
      "DisplayName": null,
      "Username": null,
      "Email": null,
      "Password": null,
      "Status": null,
      "Role": null,
      "PercentageCompleted": null,
      "TotalServices": null,
      "SecondaryEmail": null
    }
  ],
  "TotalUsers": 3,
  "AvailableServices": [
    {
      "ID": "service_1",
      "Name": "Service 1",
      "Enabled": null,
      "Status": null,
      "PercentageCompleted": null,
      "IsDefault": false
    },
    {
      "ID": "service_2",
      "Name": "Service 2",
      "Enabled": null,
      "Status": null,
      "PercentageCompleted": null,
      "IsDefault": false
    },
    {
      "ID": "service_3",
      "Name": "Service 3",
      "Enabled": null,
      "Status": null,
      "PercentageCompleted": null,
      "IsDefault": false
    }
  ]
}

When the Endpoint is Called

The endpoint is called when the list of users is retrieved in customer view.

Delete User

Swagger documentation: POST ​/api​/Users​/Delete
The purpose of this endpoint is to delete a user from the external system.

Request

{
	"ID": "user_1",
	"Customer": {
		"ID": "customer_1",
		"AccountID": "1",
		"IsTest": true
	}
}

Response

{
  "Code": 0,
  "Message": "User deleted successfully",
  "Result": "user_1"
}

When the Endpoint is Called

The endpoint is called when a user is deleted.

Get Customer Details

Swagger documentation: POST ​/api​/Users​/Get​/Customer
The purpose of this endpoint is to retrieve the details of a customer from the external system.

Request

{
	"ID": "customer_1",
	"Status": "Provisioned",
	"TotalUsers": 0
}

Response

{
  "ID": "customer_1",
  "Name": "Cloud Company",
  "PrimaryDomain": "cloudcompany.com",
  "PercentageCompleted": null,
  "Status": 0,
  "IsTest": null,
  "TotalUsers": 5
}

When the Endpoint is Called

The endpoint is called when a customer is selected and their details are displayed in customer view.

User Password Reset

Swagger documentation: POST ​/api​/Users​/Password​/Reset
The purpose of this endpoint is to reset a user’s password.

Request

{
  "ID": "user_1",
  "Customer": {
    "ID": "customer_1",
    "AccountID": "1",
    "IsTest": true
  }
}

In addition to the fields described for the previous endpoint, this request body contains the following fields:

  • IsTest – Determines whether the endpoint is used for testing purposes
  • SecondaryEmail – The secondary email address specified for the user

Response

{
  "Code": 0,
  "Message": "User password reseted successfully",
  "Result": "user_1"
}

When the Endpoint is Called

The endpoint is called when a password reset is requested for a user.

User Service Management

Actions related to user service management.

Add User Service

Swagger documentation: POST ​/api​/Users​/Service​/Add
The purpose of this endpoint is to assign a service to a user.

Request

{
  "ServiceID": "basic",
  "User": {
    "ID": "user_1",
    "Customer": {
      "ID": "customer_1",
      "AccountID": "1",
      "IsTest": true
    }
  }
}

Response

{
  "Code": 0,
  "Message": "User service added successfully",
  "Result": "user_1"
}

When the Endpoint is Called

The endpoint is called when a service is assigned to a user.

Delete User Service

Swagger documentation: POST ​/api​/Users​/Service​/Delete
The purpose of this endpoint is to revoke a service assignment.

Request

{
	"ServiceID": "basic",
	"User": {
		"ID": "user_1",
		"Customer": {
			"ID": "customer_1",
			"AccountID": "1",
			"IsTest": true
		}
	}
}

Service ID – The unique identifier of the service assigned to the user.

Response

{
  "Code": 0,
  "Message": "User service removed successfully",
  "Result": "user_1"
}

When the Endpoint is Called

This endpoint is called when a service assignment is revoked.

Get User Service List

Swagger documentation: POST ​/api​/Users​/Service​/Get​/List
This endpoint retrieves the services available for a user and their status.

Request

{
	"ID": "user_1",
	"Customer": {
		"ID": "customer_1",
		"AccountID": "1",
		"IsTest": true
	}
}

Response

{
  "Services": [
    {
      "ID": "service_1",
      "Name": "Service 1",
      "Enabled": null,
      "Status": null,
      "PercentageCompleted": null,
      "IsDefault": false
    },
    {
      "ID": "service_2",
      "Name": "Service 2",
      "Enabled": null,
      "Status": null,
      "PercentageCompleted": null,
      "IsDefault": false
    },
    {
      "ID": "service_3",
      "Name": "Service 3",
      "Enabled": null,
      "Status": null,
      "PercentageCompleted": null,
      "IsDefault": false
    }
  ]
}

The response contains the IDs and Names of the services assigned to a user, as well as the Enabled field which shows their status.

When the Endpoint is Called

The endpoint is called when the Licenses section is accessed.