How can I get a list of installed packages' names (not their namespace prefixes) through API in java?

This answer describes how to get their namespace prefixes like "Rknews" for example, but not the whole name like "Redhot News" . How to get a list of the managed packages (including version numbers) installed in an org?

This is an answer for my question, but I hope a better way to do that exists. How do i retrieve all installed packages names through API?

I need this to get all installed packages using "retrieve" call, where I have to list their names. If there is another way to get all installed package files, please tell me also.

I don't think it's possible to get the package name via the Metadata API. As you stated, you can get the namespace and the version, but not the name itself.

One thing you can do is verify that a package with name X is installed in the org. With the ant migration tool, you can attempt a retrieve of the package. If the package with that name (managed or unmanaged) does not exist in the org, you get an INVALID CROSS REFERENCE ID error on the package name.

  <sf:retrieve 
    username="${sf.username}" 
    password="${sf.password}" 
    serverurl="${sf.serverurl}" 
    retrieveTarget="packaged" 
    packageNames="PACKAGE_NAME_HERE"/>
  • Thank you, but that's not what I need. Maybe you know any way to retrieve just all packages installed in my org without providing their names? – Liudmila Likhovid Oct 28 '14 at 14:46
  • I completely understand what you want to do, but I'm not sure of a way to do it via the available api's. The Metadata API doesn't provide a way to retrieve Packages, only InstalledPackages which contain a namespace and a version number only. The only way I can think of would be to use Selenium to get the list. Here's an example of a python script we use to automate beta package uploads. It goes to the package page and selects a package so it could be modified to just get all package names from that page: github.com/SalesforceFoundation/CumulusCI/blob/master/ci/… – Jason Lantz Oct 28 '14 at 15:48

This question is already answered on stackexchange, Please check below link:

How to get a list of the managed packages (including version numbers) installed in an org?

  • Thank you for the answer, but in my question I gave a link to this answer and wrote that is NOT an answer to my question, because these ways I can retrieve Namespace Prefix but NOT Names. – Liudmila Likhovid Oct 27 '14 at 18:10

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.