假设您已在Apigee中公开了API产品。您希望获得已注册API产品的所有开发人员及其应用程序的列表。
有人要求退回这些内容,请在此处记录:
http://apigee.com/docs/api/get-list-keys-apps-developers-or-companies-api-product
但它返回的ID似乎没用。如果您尝试开发人员,例如:
https://api.enterprise.apigee.com/v1/organizations/YOUR-ORG/apiproducts/YOUR-PRODUCT?query=list&entity=developers
您会找到ID列表。但是要找到与给定ID相关的开发人员是不可能的,作为获得开发人员的调用:
http://apigee.com/docs/api/get-developer
只接受电子邮件地址。
如何获取为给定API产品注册的所有开发人员及其应用的列表?
答案 0 :(得分:1)
开发人员拥有的应用程序嵌套在每个开发人员中:
https://api.enterprise.apigee.com/v1/o/{your org}/developers
将返回这样的开发人员列表:
["email@domain.com", "email2@domain2.com"]
然后,您必须遍历每个开发人员以获取其应用列表:
https://api.enterprise.apigee.com/v1/o/{your org}/developers/tesla@weathersample.com
它为您提供了大量元数据,包括应用程序:
{
"apps" : [ "weather" ],
"companies" : [ ],
"email" : "tesla@weathersample.com",
"developerId" : "Hk5mmLw9kKIM95qF",
"firstName" : "Nikolai",
"lastName" : "Tesla",
"userName" : "Nikolai",
"organizationName" : "jokeindex",
"status" : "active",
"attributes" : [ ],
"createdAt" : 1357858239543,
"createdBy" : "noreply_admin@apigee.com",
"lastModifiedAt" : 1357858239543,
"lastModifiedBy" : "noreply_admin@apigee.com"
}
最后,如果您查看每个应用,您可以看到与该开发者应用相关联的产品:
https://api.enterprise.apigee.com/v1/o/{your org}/developers/tesla@weathersample.com/apps/weather
获取此详细信息:
{
"accessType" : "read",
"appFamily" : "default",
"appId" : "030fdcea-cf97-40b1-96df-12084aea513c",
"attributes" : [ {
"name" : "Developer",
"value" : "tesla@weathersample.com"
}, {
"name" : "DisplayName",
"value" : "Weather"
}, {
"name" : "Notes",
"value" : "not yet"
}, {
"name" : "lastModifier",
"value" : ""
} ],
"callbackUrl" : "http://example.com/callback",
"createdAt" : 1363578857830,
"createdBy" : "adminui@apigee.com",
"credentials" : [ {
"apiProducts" : [ {
"apiproduct" : "weather",
"status" : "approved"
} ],
"attributes" : [ ],
"consumerKey" : "{key}",
"consumerSecret" : "{key}",
"expiresAt" : -1,
"scopes" : [ ],
"status" : "approved"
} ],
"developerId" : "Hk5mmLw9kKIM95qF",
"lastModifiedAt" : 1386042817268,
"lastModifiedBy" : "michael.bissell@apigee.com",
"name" : "weather",
"scopes" : [ ],
"status" : "approved"
}
如果要使用一个脚本查询整个组织,请查看git上的组织快照工具:
https://github.com/apigee/api-platform-samples/tree/master/tools
这将询问每个开发人员和每个应用程序,并将其放入文件系统中的一个漂亮的树结构中,以供将来参考。