List KeyValueMaps returns nothing

jivanpatil
Participant III

I am trying to get list of all KVMs and the curl returns [ " privacy " ] . I think it is the permission issue, but shouldn't I get permission denial exception ?

Request: https://api.enterprise.apigee.com/v1/organizations/{my-org}/keyvaluemaps

curl header are set properly with above url.

Solved Solved
0 6 296
1 ACCEPTED SOLUTION

Your API call is working. That is the actual name of a (system) KVM that exists in all orgs. And it seems that's the only org scoped KVM you have.

You can list its entries with

https://api.enterprise.apigee.com/v1/organizations/{my-org}/keyvaluemaps/privacy

You'll get something like this

{
  "encrypted": true,
  "entry": [
    {
      "name": "privacyContact:[
  {\"title\":\"Data Protection Officer\"},{\"title\":\"EU Representative\"}]",
      "value": "*****"
    },
    {
      "name": "enableTraceConsent:{\"name\":\"\",\"timestamp\":0,\"consent\":true}",
      "value": "*****"
    }
  ],
  "name": "privacy"
}

View solution in original post

6 REPLIES 6

Your API call is working. That is the actual name of a (system) KVM that exists in all orgs. And it seems that's the only org scoped KVM you have.

You can list its entries with

https://api.enterprise.apigee.com/v1/organizations/{my-org}/keyvaluemaps/privacy

You'll get something like this

{
  "encrypted": true,
  "entry": [
    {
      "name": "privacyContact:[
  {\"title\":\"Data Protection Officer\"},{\"title\":\"EU Representative\"}]",
      "value": "*****"
    },
    {
      "name": "enableTraceConsent:{\"name\":\"\",\"timestamp\":0,\"consent\":true}",
      "value": "*****"
    }
  ],
  "name": "privacy"
}

Yes, and keep in mind that KVMs can be scoped to org or environment.

If you are looking for environment-scoped KVMs then you need to modify the URL path to be

/v1 /o /{my-org} /e /{my-env} /keyvaluemaps

(You will need to remove the spaces before using the above. I don't know why, when I put a path in one of my responses, it doesn't display. So I embed spaces and it shows up that way. )

I am able to get the response with environment level. The thing is we manually created all kvm from Edge UI. Seems like those are created at env level and not org level. How to know if the resource is at org level ? Any endpoint where I can get this metadata ?

KVMs created via a UI are always scoped at the environment level (Notice the environment dropdown field).

To know if a resource is at the environment level, use your original API call

https://api.enterprise.apigee.com/v1/organizations/{my-org}/keyvaluemaps

If the KVM is listed in the response, then you know it's at the org level.

When you use the Admin UI to create KVMs and entries, today, you will be administering environment-scoped KVMs. IT is not possible today to admin org-scoped KVM in the Apigee Edge UI, Today. We may change that, but for now, that's how it works.

Thanks Dino. This helps.