—Rate this article—
 

Create KeyValueMap

API Platform Base Path: https://api.enterprise.apigee.com/v1/o/{org_name}

API Resource Path: /keyvaluemaps

Creates a KeyValueMap

Verb: POST

Auth: Basic Auth

Media types:

application/json
text/xml

Creates a KeyValueMap.

A key/value map is a simple structure for persistently storing name/value pairs as entries in a named map. The entries in a key/value map can be retrieved at runtime by policies or code running on the API Platform.

Key/value maps can be used to support profile-based access control, for supporting certain non-standard protocols, application specific behavior, and so on.

Key/value maps can be scoped to the organization, environment, and API proxy level.

To scope Key/value maps to these entities, use URI parameters as demonstrated in the sample requests.

Sample Request:
Scoped to organization: $ curl -H "Content-Type:application/json" -X POST -d \ '{ "entry" : [ { "name" : "dev", "value" : "user1" } ], "name" : "prodmap" }' \ -u myname:mypass https://api.enterprise.apigee.com/v1/o/{org_name}/keyvaluemaps Scoped to environment: $ curl -H "Content-Type:application/json" -X POST -d \ '{ "entry" : [ { "name" : "dev", "value" : "user1" } ], "name" : "prodmap" }' \ -u myname:mypass https://api.enterprise.apigee.com/v1/o/{org_name}/environments/{env_name}/keyvaluemaps Scoped to API: $ curl -H "Content-Type:application/json" -X POST -d \ '{ "entry" : [ { "name" : "dev", "value" : "user1" } ], "name" : "prodmap" }' \ -u myname:mypass https://api.enterprise.apigee.com/v1/o/{org_name}/apis/{api_name}/keyvaluemaps
Request Payload Elements:
Name Description Default Required?
entry The name/value pair for the entry, that defines the data to be stored N/A Yes
name The name of the map to be created N/A Yes
Sample Response:
  {
  "entry" : [ {
    "name" : "dev",
    "value" : "user1"
  } ],
  "name" : "prodmap"
}
Response Payload Elements:
Name Description
entry The name/value pair for the entry, that defines the data to be stored
name The name of the map to be created
Errors
Failure 4xx with proper error message
{
  "code" : "keyvaluemap.service.keyvaluemap_already_exist",
  "message" : "keyvaluemap already exists",
  "contexts" : [ ]
}

Help or comments?

  • Something's not working: See Apigee Support
  • Something's wrong with the docs: Click Send Feedback in the lower right.
    (Incorrect? Unclear? Broken link? Typo?)