Creates a new dictionary. A dictionary provides efficient lookup and mapping operations over a collection of strings.
The user must be authenticated and have write permissions to the associated site group.
Request
The request object has the following fields:
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
The site group identifier that determines where the new dictionary will logically belong, i.e., the new dictionary's "parent". A user's permissions for the dictionary are inferred from the user's permissions for the site group. |
|
|
String |
Yes |
A brief description of the dictionary's purpose and function. |
|
|
String |
No |
A longer description of the dictionary's purpose and function. |
|
|
String |
No |
The dictionary data, provided as a base-64 encoded Excel workbook. The Excel workbook must adhere to certain formatting rules . |
|
|
Object |
No |
The dictionary data, provided as a JSON object. The JSON object must adhere to certain formatting rules . |
The workbook and entries fields are mutually exclusive, only one of them can be provided.
See here for Excel workbook formatting rules.
See here for JSON object formatting rules.
If workbook is provided and the workbook contains Japanese data, note that the workbook should not contain any phonetic run.aspx) data. Otherwise such data might be part of the data extracted from the workbook, and pollute the generated dictionaries. Possible ways to achieve this include, e.g., exporting the data to *.csv and then reimporting the data, or running a macro that deletes the phonetic run data.
Response
The response object has the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
The identifier of the newly created dictionary. |
|
|
String |
The name of the newly created dictionary. |
|
|
Array of String |
If |
Examples
Create a new dictionary placeholder.
Since neither workbook nor entries is provided, the placeholder actually holds no dictionary data.
This can be added at at later time using the [/processing/dictionary/update](page:///processing/dictionary/update) API method.
$ cx.py /processing/dictionary/create '{"siteGroupId":"1234567","name":"My dictionary"}'
{
"dictionaryId": "9232299593928824873",
}