Key-value storage
The key-value storage keeps the parameters (such as text color or company name) and their values that define the email templates for client notifications. The parameters and their values are stored as key-value pairs.
GET[host]/api/v2/storage/values |
|
GET[host]/api/v2/storage/values/{valueId} |
|
POST[host]/api/v2/storage/values |
|
PATCH[host]/api/v2/storage/values/{valueId} |
|
DELETE[host]/api/v2/storage/values/{valueId} |
Use these methods to view and manage tags that are used to group key-value pairs defined in the Back Office.
GET[host]/api/v2/storage/tags |
|
GET[host]/api/v2/storage/tags/{tagId} |
|
POST[host]/api/v2/storage/tags |
|
PATCH[host]/api/v2/storage/tags/{tagId} |
|
DELETE[host]/api/v2/storage/tags/{tagId} |
Get a list of key-value pairs
Use this method to obtain a list of key-value pairs defined in the Back Office.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameters are for this method:
- key
The name of a key.
- value
The value assigned to a key.
- type
The value type. Possible values:
string
html
mail
url
The following sorting parameter is available for this method:
- createTime
The date and time when a key-value pair was created.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/storage/values
curl --location -g 'https://host.name/api/v2/storage/values?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[key]=support_email&filter[value]=suppor@exmaple.com&filter[type]=string' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains an array of Key-Value Pair objects providing information about the key-value pairs matching the request parameters.
Get key-value pair details
Use this method to obtain detailed information about a specific key-value pair.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- valueId required
The identifier of a key-value pair.
GET[host]/api/v2/storage/values/{valueId}
curl --location 'https://host.name/api/v2/storage/values/1' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Key-Value Pair object providing information about the specified key-value pair.
Create a key-value pair
Use this method to add a new key-value pair.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters for a key-value pair:
- key string required
The name of a key.
- type string required
The value type. Possible values:
string
html
mail
url
- isEnabled boolean required
If
true
, a key-value pair is enabled; otherwise,false
.- value string required
The value assigned to a key.
- tags array
An array of integer values specifying the tags that you want to assign to a key-value pair.
- resources object
An array of resource objects specifying the localized strings for user interface pages displayed to a client.
POST[host]/api/v2/storage/values
curl --location --request POST 'https://host.name/api/v2/storage/values' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"key": "support_email",
"type": string,
"isEnabled": 0,
"value": "support@example.com",
"tags": [
1,
2
],
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "value"
},
{
"key": "caption",
"locale": "en_US",
"value": "value"
}
]
}'
Response
A response contains a Key-Value Pair object providing information about the created key-value pair.
Update a key-value pair
Use this method to update a key-value pair.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- valueId required
The identifier of a key-value pair.
Body:
The following field values can be updated for a key-value pair:
- key string
The name of a key.
- value string
The value assigned to a key.
- type string
The value type. Possible values:
string
html
mail
url
- isEnabled boolean
If
true
, a key-value pair is enabled; otherwise,false
.- tags array
An array of integer values specifying the tags that you want to assign to a key-value pair.
- resources object
An array of resource objects specifying the localized strings for user interface pages displayed to a client.
PATCH[host]/api/v2/storage/values/{valueId}
curl --location --request PATCH 'https://host.name/api/v2/storage/values/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"key": "support_mail",
"value": "support@example.com",
"type": string,
"isEnabled": 0,
"tags": [
1,
2
],
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "value"
},
{
"key": "caption",
"locale": "en_US",
"value": "value"
}
]
}'
Response
A response contains a Key-Value Pair object providing information about the key-value pair that was updated.
Delete a key-value pair
Use this method to remove a specified key-value pair.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- valueId required
The identifier of a key-value pair.
DELETE[host]/api/v2/storage/values/{valueId}
curl --location --request DELETE 'https://host.name/api/v2/storage/values/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get key storage tag details
Use this method to obtain detailed information about a specific tag used to mark the key-value pairs defined in the Back Office.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- tagId required
The identifier of a tag.
GET[host]/api/v2/storage/tags/{tagId}
curl --location 'https://host.name/api/v2/storage/tags/1' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Key-Value Tag object providing information about the specified tag.
Create a key storage tag
Use this method to add a new tag that can be used to group the key-value pairs defined in the Back Office.
Request
Header parameters:
Authorization: Bearer <token>
Body:
Specify the following parameters for a tag:
- caption required
The tag name.
- isEnabled required
If
true
, a tag is enabled; otherwise,false
.
POST[host]/api/v2/storage/tags
curl --location --request POST 'https://host.name/api/v2/storage/tags' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"caption": "email_config",
"isEnabled": 1
}'
Response
A response contains a Key-Value Tag object providing information about the created tag.
Update a key storage tag
Use this method to update a tag.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- tagId required
The identifier of a tag.
Body:
The following field values can be updated for a tag:
- caption
The tag name.
- isEnabled
If
true
, a tag is enabled; otherwise,false
.
PATCH[host]/api/v2/storage/tags/{tagId}
curl --location --request PATCH 'https://host.name/api/v2/storage/tags/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"caption": "mail",
"isEnabled": 1
}'
Response
A response contains a Key-Value Tag object providing information about the tag that was updated.
Delete a key storage tag
Use this method to remove a specified tag.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- tagId required
The identifier of a tag.
DELETE[host]/api/v2/storage/tags/{tagId}
curl --location --request DELETE 'https://host.name/api/v2/storage/tags/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.