Dynamic create rest url

Dynamic create rest url

  

Hi all,

Here is my problem:


I need to get information from a group of fitbit users.

You can get users information through out the Fitbit rest API and it seems to be easy.


But it has to be done for each user individually.


So how can i dynamic build the rest call url ???  


I am assuming I will have to do a loop on my users table and get the fituserId

 - build the rest call url

- get the response

- insert in DB


Anyone has done anything similar ???


Any help is welcome.


Thanks

Hi Decarlos,

Have you tried to replace the [user-id] by {userid} when inputing the rest URL, like:

https://api.fitbit.com/1/user/{userid}/profile.json

Does this work?

Cheers

Henrique Batista wrote:

Hi Decarlos,

Have you tried to replace the [user-id] by {userid} when inputing the rest URL, like:

https://api.fitbit.com/1/user/{userid}/profile.json

Does this work?

Cheers

Hi Henrique

I havent actually, but what information it will bring back ? i still need to get the details for particular users so i need to pass the userid right ?


cheers


Solution

Hello Decarlos,


Yes, by replacing the url as Henrique suggested it will make it as a dynamic parameter, meaning that every time you call the service you need to define the userid. Resulting that the service will bring the information related with that user.


Regards

Solution

Hi Davide,

 I got it now. :)

I will try that, 

thanks