0

in the context of tesing Alfresco Share queries (webscripts), I'm trying to call the search REST API from from the command line. I've tried curl (1), Async Http Client (2) or PowerShell-3.0 with the newly introduced cmdlet Invoke-RestMethod (3).

The query for MYTERM I use is

/share/proxy/alfresco/slingshot/search?site=&term=name%3A%22MYTERM%22&tag=&maxResults=20&sort=&query=&repo=false

The query in the browser returns 10 results. I also tried it with a tool like Advanced Rest Client for Chrome which brings same results. But with curl, AHC or PowerShell, I always get only 1 result!

Invoke-RestMethod -Credential $myCredentials -Method GET -Uri 'http://HOSTADDRESS/share/proxy/alfresco/slingshot/search?site=&term=name%3A%22MYTERM%22&tag=&maxResults=20'

What might I be missing?

halfer
  • 19,824
  • 17
  • 99
  • 186
jgran
  • 1,111
  • 2
  • 11
  • 21
  • How are you passing your credentials? – Gagravarr Jul 04 '13 at 10:40
  • Powershell> $myCredentials = Get-Credential – jgran Jul 04 '13 at 11:54
  • [curl] curl -X GET -u login:password 'http://HOSTADDRESS/share/proxy/alfresco/slingshot/search?site=&term=name%3A%22MYTERM%22&tag=&maxResults=20' ; [Async HTTP Client] realm = new Realm.RealmBuilder().setPrincipal(login).setPassword(password).setUsePreemptiveAuth(true).setScheme(Realm.AuthScheme.BASIC).build(); see [AHC Authentication](http://sonatype.github.io/async-http-client/auth.html) – jgran Jul 04 '13 at 12:18

0 Answers0