How does one download from archiva 2.1.1 rest api?

1k views Asked by At

I always get 204 while trying to search for an artifact via the API.

example url: http://archiva.mydomain.com/restServices/archivaServices/searchService/artifact?a=test&g=com.mydomain.test&v=1.0

The groupId, artifactId and version all match up in the pom and also show up on the archiva web interface properly.

In order to download this artifact directly I use this link: http://archiva.mydomain.com/repository/internal/com/mydomain/test/test/1.0/test-1.0.war

1

There are 1 answers

0
Chris Harris On

Consult the following .wadl:

http://< your_host_name>:< your_port>/archiva/restServices/archivaServices?_wadl

After some trial and error using the provided .wadl, I was able to successfully query the REST API for a known, existing artifact using Chrome's Postman. I started with observableRepoIds, since it doesn't require parameters. Next, I moved on to a resource with only 1 parameter: getAllGroupIds. Using those successful attempts as baselines, I attempted the artifact resource.

The following query worked for me:

http://< your_host_name>:< your_port>/archiva/restServices/archivaServices/searchService/artifact?g=com.atlassian.xmlrpc&a=atlassian-xmlrpc-binder&v=0.11

Within the Header, I specified the following:

Accept = text/html

Authorization = Basic < your encrypted credentials here>