0
votes

all. recently I learned wso2 api manager 1.4+ and see the publisher apis are open. As I tried to invoke the apis using the RESTClient in api store, the response show "{"message" : "AuthenticateError", "error" : true}". I follow the doc in here: http://docs.wso2.org/display/AM140/Publisher+APIs. I am not familiar with rest apis, I just invoke the GET method, using the URL: http://**:9763/publisher/site/blocks/listing/ajax/item-list.jag, and get the error above. did I miss something or use the wrong format?

then I use curl to test the apis, it works. root@appfactory01:~# curl -b cookies http://*:9763/publisher/site/blocks/listing/ajax/item-list.jag?action=getAllAPIs {"error" : false, "apis" : [{"provider" : "admin", "subs" : 0, "name" : "redmine", "thumb" : "/registry/resource/_system/governance/apimgt/applicationdata/icons/admin/redmine/1.0.0/icon", "version" : "1.0.0", "status" : "PUBLISHED"}]}

1

1 Answers

0
votes

It is because when using curl you are setting cookies through -b cookies option, but when using RESTClient it's not used. That's why you get Authenticate Error. You can add the -v option to curl to see the exact request and response.

To access through RESTClient add the Cookie Header as follows. Get the value for JSESSIONID from the cookies file used with curl or by observing the output of curl with -v option.

Cookie:JSESSIONID=8BB4617ABC21786D90A450xxxxxxx

and use the following url with GET request.

http://localhost:9763/publisher/site/blocks/listing/ajax/item-list.jag?action=getAllAPIs