Browse
Hyland Connect
Hyland Community
Help
Sign In
What's New
Platform
Content Innovation Cloud
Content Innovation Cloud Blog
Alfresco
Alfresco Forum
Alfresco Blog
Alfresco Archive
Nuxeo
Nuxeo Forum
Nuxeo Blog
Community Blog
problem access REST API via Grail plugin rest-client-build
suseno
Champ on-the-rise
Options
Mark as New
Subscribe to RSS Feed
Permalink
Print
05-22-2013
06:24 AM
I'm facing a problem call activiti REST API..
I'm calling REST API using grails plugin rest-client-build..
my code :
[
def index() {
def resp = rest.post('
http://localhost:8080/activiti-rest/service/login
') {
accept "application/json"
contentType "application/json"
json {
userId='kermit'
password='kermit'
}
}
println resp.status
}
def get() {
def resp = rest.get('
http://localhost:8080/activiti-rest/service/process-instances
') {
accept "application/json"
contentType "application/json"
}
println resp.status
}
]
when i called index().. it is success .. REST API response 200
but when i called get() .. it always returns 403
What should i do to correct that problem
thx
Labels:
Labels:
Archive
Activiti Engine
BPM Archive
All forum topics
Previous Topic
Next Topic
2 REPLIES
2
jbarrez
Star Contributor
Options
Mark as New
Subscribe to RSS Feed
Permalink
Print
05-22-2013
11:11 AM
403 means you must be authenticated. The Activiti REST api uses BASIC auth, so you need to set the correct headers.
suseno
Champ on-the-rise
Options
Mark as New
Subscribe to RSS Feed
Permalink
Print
05-23-2013
01:00 AM
Hi Joram,
Thx for your info..
Now i'm successfully access the Activiti REST API..
this is my sample code in GRAILS using rest-client-builder plugin
[
def get() {
def resp = rest.get('
http://localhost:8080/activiti-rest/service/user/kermit
') {
auth "kermit","kermit"
accept "application/json"
contentType "application/json"
}
println resp.status
println resp.json.id
println resp.json.lastName
println resp.json
}
}
]
output :
200
kermit
The Frog
[id:kermit, lastName:The Frog, email:
[email protected]
, firstName:Kermit]
Post Reply