Update manager

The Update manager method is used for updating information about a manager of the current reseller or any of its downstream resellers.

An API token of a manager is required for authorization. To get an API token via the Operator Control Panel, see Viewing and updating Manager's information

The manager's API token specified in an API request determines:

  • The role and access level of the manager, which determine the availability of a method.
  • The current reseller and downstream resellers accessible within a method.

Updating information is available as follows:

  • For managers with the System administrator role (see Managers' Roles) — about any manager.
  • For managers with other roles — only about the manager whose token is specified in the API request.
PATCH {base_url}/api/v3/resellers/{reseller_id}/managers/{manager_id}

Arguments

Name

Parameter Type

Data type

Required/ Optional

Description

X-Api-TokenheaderstringRequiredAPI token of a manager that performs the operation (see Viewing and updating Manager's information)
Content-TypeheaderstringRequiredMedia type of the request. Specify the following: application/vnd.api+json
AcceptheaderstringRequired

Supported media types of the answer. Specify the following: application/vnd.api+json

base_urlpathstringRequiredActivePlatform URL
reseller_idpathintegerRequiredID of the current reseller or any of its downstream resellers (see Viewing and updating Reseller general information)
manager_idpathintegerRequiredID of the manager
dataformobjectRequiredInformation about the attributes of the operation

attributesformobjectRequiredAttributes of the operation


nameformstringOptionalManager's name


statusformstringOptional

Status of the manager:

  • active — access to the Operator Control Panel is allowed.
  • inactive — access to the Operator Control Panel is blocked.


roleformstringOptional

Manager's role (for the list of roles, see Managers' Roles)

Updating the role parameter is available only using the token of a manager with the System administrator role.



manager_role_idformstringOptional

The access level ID (see Managing access levels and Get list of access levels). Not used if the current or new value for the manager role = admin

Updating the manager_role_id parameter is available only using the token of a manager with the System administrator role.



passwordformstringOptionalManager's password which will be used for signing in to the Operator Control Panel. The password requirements see in Password Settings


phoneformstringOptional

Manager's phone number:

  • + < country code > < city code or network code > < phone number >.
  • 00 < country code > < city code or network code > < phone number >.


manager_keyformstringOptional

Unique manager's key

This key allows linking an Account to a Manager (see Viewing and updating an Account's details) automatically when a customer orders a new Service via Customer Store with a special URL parameter (see Buy-link template for ordering a Service via Storefront). The key can include uppercase and lowercase characters, numbers, underscore, dot, and dash. The key is case-sensitive, so it is important to specify it in a buy-link exactly as on the manager information page. For example, carter81 and Carter81 are different keys, and they will not work together.



custom_attributesformobjectOptional

Manager's attributes (see Managing Attributes)




dataformarrayOptionalInformation about a manager's attribute




keyformstringOptionalManager's attribute key




valueformstringOptional

Manager's attribute value.

Depending on the value type, the value is specified in the following formats:

  • Checkbox:
    • 1 for true.
    • 0 for false.
  • Date: DD.MM.YYYY.
  • List: Key of the element.

Response model

If no errors are encountered, the method returns data as the updated information about the manager (see Get manager).

All validation errors for the specified manager attributes are displayed similar to the Operator Control Panel (see Adding a Manager in ActivePlatform. Operator Control Panel).

Request example

PATCH /api/v3/resellers/1/managers/483
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
{
    "data": {
        "attributes": {
            "status": "inactive"            
        }
    }
}

Response example

{
    "data": {
        "id": "483",
        "type": "managers",
        "attributes": {
            "created_at": "2020-11-16T12:27:49.922+03:00",
            "updated_at": "2020-11-16T17:38:03.779+03:00",
            "reseller_id": 1,
            "name": "Rudy McLaughlin",
            "status": "inactive",
            "email": "terry@example.net",
            "role": "admin",
            "manager_role": {
                "id": null,
                "name": null
            },
            "phone": "+375290000000",
            "photo": null,
            "manager_key": "",
            "mfa_required": true,
            "custom_attributes": {
                "test": "1"
            }
        }
    }
}