Get Values¶
Description¶
This operation returns multiple key-value pairs for the specified key names.
Method¶
POST
Endpoint URL¶
Important
Make sure to replace xxxx in the domain name in the request specification below to the one assigned to your application.
https://xxxx.backendless.app/api/hive/[hive-name]/key-value
where:
Argument | Description |
---|---|
[hive-name] |
Name of a hive where the operation is performed. |
Request Headers¶
Content-Type:application/json
where:
Argument | Description |
---|---|
Content-Type |
Must be set to application/json . This header is mandatory. |
Request Body¶
A JSON array containing key names as strings.
["key1", "key2", ...]
Response Body¶
A JSON object with keys from the request body and the corresponding values. In case the specified keys do not exist, the operation returns an empty JSON object.
Example¶
Consider the following key-value store:
The example below retrieves values for the "USA"
and "Japan"
key names:
curl --location --request POST "https://xxxx.backendless.app/api/hive/countries/key-value" \--header 'Content-Type: application/json' \--data-raw '["USA", "Japan"]'
where:
Argument | Description |
---|---|
countries |
Name of a hive where the operation is performed. |
["USA","Japan"] |
Array containing key names to get the corresponding values for. |
Response
{
"USA": "Washington DC",
"Japan": "Tokyo"
}
Codeless Reference¶
where:
Argument | Description |
---|---|
hive name |
Name of a hive where the operation is performed. |
key names |
Key names identifying key-value pairs. |
Returns key-value pairs for the specified keys.
Consider the following Key Value storage:
The example below gets two key-value pairs for the specified keys ("USA"
and "Japan"
):
The output will look as shown below after the Codeless logic runs.