create_resource
To create a new resource, use the core/create_resource method.
svc=core/create_resource¶ms={
"creatorId": <long>,
"name": "<text>",
"dataFlags": <uint>,
"skipCreatorCheck": <bool>
}
Parameters
| Parameter | 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 | Flags with the resource properties for the response (see Resources). |
| 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 they had no account. To create a resource for such a user, use skipCreatorCheck=1. The flag is used for that purpose only. The purpose of this limitation is to protect the hierarchy. |
Response
If the request is completed successfully, the response is returned in the following format:
{
"item": { /* Created resource. */
...
},
"flags": <uint> /* Applied flags with properties. */
}
The format of the item parameter is described on the Resources page.
If the request fails, an error code is returned.
Error codes
| Error code | Description |
|---|---|
| 4 | Wrong input parameters, or the length of the name parameter is out of bounds (4–50 characters). |
| 6 | One of the following errors:
|
| 7 | Failed to check the create_resources billing transaction. |
| 1002 | A resource with this name already exists. |
| 2014 | The selected user is the creator of some system objects. |