Update a Reseller's Manager

The Update a Reseller's Manager method is used for updating information about a Manager of the current Reseller or any of its downstream Resellers.

Access to the current Reseller and downstream Resellers is determined by the Manager's token in the API request.

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 the Manager that performs the operation (see Viewing and updating manager's information)
Content-TypeheaderstringRequiredIndicates the media type (text/html or text/JSON) of the request that is sent to the server by the client (browser)
AcceptheaderstringRequiredInformation about data types that the client (browser) supports
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


nameformstringOptional
Manager'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.



passwordformstringOptional
Manager's password which will be used for signing in to the Operator Control Panel


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_keyformstringOptionalUnique Manager's key


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 the Reseller's Manager by ID).

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",
            "phone": "+375290000000",
            "photo": null,
            "custom_attributes": {
                "test": "1"
            }
        }
    }
}