Create a Reseller's Manager
The Create a Reseller's Manager method is used for creating a Manager for 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.
Only Managers with the System administrator role can create new a Manager (see Managers' roles).
POST {base_url}/api/v3/resellers/{reseller_id}/managers
Arguments
Name | Parameter Type | Data type | Required/ Optional | Description | |||||
---|---|---|---|---|---|---|---|---|---|
X-Api-Token | header | string | Required | API token of the Manager that performs the operation (see Viewing and updating manager's information) | |||||
Content-Type | header | string | Required | Indicates the media type (text/html or text/JSON) of the request that is sent to the server by the client (browser) | |||||
Accept | header | string | Required | Information about data types that the client (browser) supports | |||||
reseller_id | path | integer | Required | ID of the current Reseller or any of its downstream Resellers (see Viewing and updating reseller general information) | |||||
data | form | object | Required | Information about the attributes of the operation | |||||
attributes | form | object | Required | Attributes of the operation | |||||
name | form | string | Required | Manager's name | |||||
form | string | Required | Manager's email which will be used as a login to the Operator Control Panel | ||||||
role | form | string | Required | Manager's role (for the list of roles, see Managers' roles) | |||||
password | form | string | Required | Manager's password which will be used for signing in to the Operator Control Panel | |||||
phone | form | string | Optional | Manager's phone number:
| |||||
manager_key | form | string | Optional | Unique Manager's key | |||||
custom_attributes | form | object | Optional | Manager's Attributes (see Managing attributes) | |||||
data | form | array | Optional | Information about a Manager's Attribute | |||||
key | form | string | Depends on the attribute | Manager's Attribute key | |||||
value | form | string | Depends on the attribute | Manager's Attribute value. Depending on the value type, the value is specified in the following formats:
|
Response model
If no errors are encountered, the method returns data as the information about the created Manager (see Get the Reseller's Manager by ID).
All validation errors for the Manager attributes are displayed similar to the Operator Control Panel (see Adding a manager in ActivePlatform. Operator Control Panel).
Request example
POST /api/v3/resellers/1/managers
Host: test.activeplatform.com
Content-Type: application/vnd.api+json
X-Api-Token: vY5fwetestK3gJXZH5uHCw
Accept: application/vnd.api+json
{
"data": {
"attributes": {
"name": "Angelica Johnson",
"email": "nigel65@example.org",
"role": "admin",
"password": "qwerty",
"phone": "+375290000000",
"custom_attributes": {
"data": [
{
"key": "test",
"value": "1"
}
]
}
}
}
}
Response example
{
"data": {
"id": "317",
"type": "managers",
"attributes": {
"created_at": "2020-12-09T08:17:47.773+03:00",
"updated_at": "2020-12-09T08:17:47.776+03:00",
"reseller_id": 1,
"name": "Angelica Johnson",
"status": "active",
"email": "nigel65@example.org",
"role": "admin",
"phone": "+375290000000",
"photo": null,
"custom_attributes": {
"test": "1"
}
}
}
}