Project

General

Profile

how can i get the avatar info by http rest api?

peirong jiang
Added over 3 years ago

I just test the url :

http://10.5.1.48:8080/rest/avatar/admin@10.5.1.48

it dones't work,return "404 not found".

you can see it's details by the snapshot.

something wrong?


On the other hand,have any other way to get user vcard info by http-rest-api?

I am really appreciated if you can help me!


Replies (3)

Added by Daniel Wisnewski IoT 1 Cloud over 3 years ago

Can you share your init.properties file? Have you enabled the rest module as well as proper api keys as described here?

https://projects.tigase.org/projects/tigase-http-api/wiki/Configuration

Added by Wojciech Kapcia TigaseTeam over 3 years ago

peirong jiang wrote:

I just test the url :

http://10.5.1.48:8080/rest/avatar/admin@10.5.1.48

it dones't work,return "404 not found".

you can see it's details by the snapshot.

something wrong?

As per documentation:

Request using GET method for url /rest/avatar/admin@test-domain.com will return avatar image for user admin@test-domain.com if avatar is set in user vcard or will return http error 404. Example of full url for avatar of user admin@domain.com

Please make sure that user admin@10.5.1.48 has avatar set.

Added by peirong jiang over 3 years ago

tkx,i have resolved it.

default the user's avatar is null.need put the photo to /rest/avatar/admin@test-domain.com (type: put) first, or not will return not found.

    (1-3/3)