create_resource
The create_resource function is used to create new resources.
svc=core/create_resource¶ms={"creatorId":<long>,
"name":"<text>",
"dataFlags":<uint>,
"skipCreatorCheck":<bool>}
Parameters
| Name | Description |
|---|---|
| creatorId | The ID of the user that should be indicated as the creator of the new resource. |
| name | Resource name (4–50 characters). |
| dataFlags | The flags with the resource properties for the returned result. See the resources page. |
| skipCreatorCheck | A special flag. 1 — enable. The default value is 0.You can’t create an account for a user that has created items while he had no account. To create a resource for such user, use skipCreatorCheck=1. The flag is used for that purpose only. The purpose of this limitation is to protect the hierarchy. |
Returned result
{
"item":{ /* resource created */
...
},
"flags":<uint> /* applied flags with properties */
}
The format of the item parameter is described on the resources page.
Possible error codes:
| Code | Description |
|---|---|
| 2014 | The selected user is the creator of some system objects. |
| 1002 | Failed to fetch the creator with the desired ID. |
| 7 | Failed to check the create_resources billing. |
| 6 | One of the following errors:
|
| 4 | Wrong input parameters or the length of the name parameter is out of bounds (4–50 characters). |