REST URL Android
  • Hi Karim,

    I have 2 fragments in android that do background activities in a parallel mode(I cant know which fragment loads and starts its background calls first)
    1 fragment loads the profile image of the user and the other loads chats of group of users with their profile images
    among these profile images I have the profile image of the user as well

    I know that these are android details that you shouldn't worry about, but I mentioned this just to clarify my request
    Actually what I want is that in both requests 
    1- getting profile image 
    2-getting chats with image url

    I want to guarantee that these have the same signature although they are 2 different requests , so that the current user have 1 url to the same profile image on the profile and chat activity.

    Shall I send a common timestamp 2 both requests with same action so that I get same signature this logic.

  • Hello,

    You could use the same time-stamp twice as you suggest. 

    However, I don't understand why do you need to have the exact same signature? The signature is a way to authenticate the request against Apstrata, it is not a resource identifier. Therefore you can have two different signatures on two distinct URLs pointing to the same resource (the profile image).

    Could you please elaborate?
  • Hi Karim,

    I am using an image library that listens to URL image and if the URL of an image changes it automatically updates all the images of the same URL my case if a user updates his profile image or uploads a new one in the profile page it should updates in the list of chats as well . That's why I need to have same URL for this image.
    better to use Token-based authentication in this case?

  • Yes, token based authentication is a good option in your case, especially that the Android SDK takes care on renewing the token at regular intervals (except when the app is off).
  • Hi Karim,

    I will be using REST API for now.
    how REST handles renew Token, as I knew there is a expiry time for a token, lets suppose we have a logged user and after some time his token expired how we handle this in regular intervals ?


  • When generating a token, you can specify the token expiration and lifetime (or you can rely on the default values). If you are not using the Android SDK anymore, it is up to your code to regularly invoke the RenewToken API in order to refresh your token (before it expires or before it becomes invalid). 
  • Hi Karim,

    ok thank you.
    Concerning updating the Android SDK (apache http library removal) kindly notify us when it is done and available.


Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!