Project

General

Profile

How to run the http api in tigase and configure it to make the rest calls.

Abhinav Gupta
Added about 3 years ago

Hi Everyone,

I am trying to configure the tigase server to use the pubsub component by making the rest calls.

For that I am trying to make the http api configured first on the server.

Please anyone can tell me what to do about this.

I am attaching my conf details (init.properties) files and logs as well.

The output of netstat below suggests that the server is listening on port 8080, i believe.

igase@tigase:/home/server/tigase$ netstat -tunlp | grep 8080

(Not all processes could be identified, non-owned process info

will not be shown, you would have to be root to see it all.)

tcp6 0 0 :::8080 :::* LISTEN 31624/java

tigase@tigase:/home/server/tigase$

but when i am trying to run the examples from the link below,

https://projects.tigase.org/boards/17/topics/78

I am getting no response.

Any advice and suggestions on the matter is highly appreciated.

Thanks and Regards

Abhinav


Replies (12)

Added by Daniel Wisnewski IoT 1 Cloud about 3 years ago

From your logs, the server is unable to load javax.servlet.http jar, which is required for any http/rest interaction with the server. In fact, if the logs are complete, the system just stops loading and Tigase is not even running. This seems like a similar issue you hard earlier with the files in your /jars directory being incomplete or out of date. Have you imported or extracted any specific jars since your install?

Your configuration seems correct otherwise.

Added by Abhinav Gupta about 3 years ago

Hi Daniel,

I appreciate your effort to look into my case.

Thanks....

I am uploading the listing of the jar file.

Could you please let me know which file is missing and how shall i get it.

I am using tigase 7.0.2 versions.

I am stuck at this.

Please help.

Added by Daniel Wisnewski IoT 1 Cloud about 3 years ago

Yeah, it looks llike you have much older versions of some of those files.

swing over to https://projects.tigase.org/projects/tigase-server/files and grab the dist-max.tar.gz and replace the /jars directory with what is in there

That should solve your version mismatch issue.

Added by Abhinav Gupta about 3 years ago

Hi Daniel,

Thanks man for the reply.

You are great sir....

But i would like to trouble you some more.

After that i was able to make call but in response i got that the api key is requuired to access the rest api but i have already set the value to open_access.

Also I was able to get to the admin page (localhost:8080/ui/) but not able to login via admin credentials (admin@blackbuck,admin).

Please assist what i am doing wrong.

Thanks

Abhinav

Added by Daniel Wisnewski IoT 1 Cloud about 3 years ago

It's a bit confusing, but if the api-key is set to open_access, you will need to add the open_access to the command api key, it's not so much a setting that disables the need for API key as a basic key to remember.

Added by Abhinav Gupta about 3 years ago

Can you please share the details of the command with me...

Thanks

Abhinav

Added by Wojciech Kapcia TigaseTeam about 3 years ago

If you've configured open-access then there is no need to modify REST URI. Please share more details of how/what you are executing.

As for the admin credentials - are you sure those are proper?

Added by Abhinav Gupta about 3 years ago

I am trying to test the rest api for the various components of the tigase...

Pubusub, muc and other in order to figure out the best way to send push notifications to the user on their browser after they were logged in...

Added by Wojciech Kapcia TigaseTeam about 3 years ago

But HOW*? please give *DETAILED information what are you trying and what are the results.

Added by Abhinav Gupta about 3 years ago

Thanks for the help and prompt response, I really do appreciate you guys helping me....

I am using the http request simulator tool to simulate the rest api calls.

When I am trying to call the /rest/pubsub/create-node api,

response is that you need valid api key to make this call.

same happened with other calls from the example usage given in tigase http api call page

Thanks and Regards

Abhinav

Added by Daniel Wisnewski IoT 1 Cloud about 3 years ago

Abhinav,

Even if open_access is your API key, you still need to have open_access in the command for API key, it cannot be blank.

If that does not work, please share with us the exact commands you are putting into the system and the resultant output, that should give us a better idea.

Added by Wojciech Kapcia TigaseTeam about 3 years ago

Abhinav Gupta wrote:

I am using the http request simulator tool to simulate the rest api calls.

When I am trying to call the /rest/pubsub/create-node api,

response is that you need valid api key to make this call.

Again - please share EXACT DETAILS.

Please also change your configuration to:

--api-keys=open_access

    (1-12/12)