Forum Discussion

ttadej's avatar
ttadej
Advisor
8 years ago

Fetch Group avatar URL via API

The docs are here: https://community.lithium.com/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv1&leaf-id=Group.avatar#Group.avatar

 

But it only returns 1 URL, mine is returning ../size/profile

 

I'd like all the available URLs.. my current workaround is to do a string replace for '/profile' with '/print' for example to get a different size. I don't any v2 calls for this type of request.

 

Any help is appreciated, thanks

1 Reply

  • ttadej - There is no API(V1 or V2) call for getting different size of group avatar,  The workaround you have been using is the only workaround as for now. However, you can make it easier. 

     

    <#assign avatar = getGroupAvatar("group-id" "print") />
     ${avatar}
    <#function getGroupAvatar id size  >
       <#assign avatar = rest("/groups/id/${id}/avatar").image.url />
       <#return avatar?split("profile")[0]+size />
    </#function>

    Pass the group id and desired avatar size e.g  message, profile, inline, favicon, print and it will return you the avatar URL according to that.