Proxima Bridge List Users

SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
Using Proxima Bridge:
How to GET list of all users including Avatar URLs, and Profile URLs ?
updated by @softdesigns: 12/23/17 07:57:54PM
brian
@brian
7 years ago
10,148 posts
https://www.jamroom.net/proxima/documentation/using-proxima/2017/the-proxima-user-service

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@brian - thanks - We have read thru all those docs, and have successfully authenticated the user.
--
Seems those docs relate to one user, or current user only ?
However, those docs above do not explain how to GET a full LIST of ALL users in the network - or maybe we are missing something?
--
Please provide Code Sample using Proxima Bridge:
How to GET a list of ALL users including User ID, Avatar URLs, and Profile URLs ?
updated by @softdesigns: 08/28/17 10:34:29AM
brian
@brian
7 years ago
10,148 posts
To be honest, "listing all users" is something you just don't want to do - it's not scalable. Think of how many mobile apps you have that allow you to list all the users on their service?

You should be able to do it with Proxima Bridge though - it uses the same search operators as the data service (all do):

https://www.jamroom.net/proxima/documentation/using-proxima/2018/the-proxima-data-service#get-search-a-collection-for-matching-objects

i.e.

/api/bridge/profile?search1=_item_id%20gt%200

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@brian - Thanks - that last URL looks promising...
--
FYI: This current task has nothing todo with any Mobile app. This will be used by nightly server Data Transformation Processes that will help us smoothly integrate a legacy system, with the more modern JR profiles.
--
Will need some time to study URL above...
--
Great Support :)
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@brian - We tried your code above: /api/bridge/profile?search1=_item_id%20gt%200
--
We get this error message:
--
"module is not enabled in Proxima Bridge"
and profile module doesn't exist in Proxima Bridge modules
--
Is there any way possible to - search or get list - of JR users via Proxima Bridge?
updated by @softdesigns: 09/15/17 09:24:59AM
michael
@michael
7 years ago
7,744 posts
"module is not enabled in Proxima Bridge" is displaying because the jrProfile module does not have an item_index.tpl file. (thats searched for in the jrProximaBridge_get_active_modules() function)

Even if that is added though, a re-run of the query returns:
{"code":400,"text":"Bad Request","note":"invalid _item_id"}

If the URL is changed to:
/api/bridge/profile/search?search1=_item_id%20gt%200

a list is returned:
{"code":200,"text":"OK","data":{"_items":[{"_app_id":"1","_created":"1505534082","_p25":"2","_profile_id":"47","_updated":"1505535000","_user_id":"25","profile_active":"1","profile_disk_usage":"0","profile_name":"tim","profile_private":"1","profile_quota_id":"1","profile_url":"tim","_item_id":"47"},{"_created":"1505534082","_profile_id":"46","_updated":"1505535000","_user_id":"25","profile_active":"1","profile_disk_usage":"0","profile_name":"tim","profile_private":"1","profile_quota_id":"1","profile_url":"tim","_item_id":"46"},{"_app_id":"1","_created":"1505534037","_p24":"2","_profile_id":"45","_updated":"1505535000","_user_id":"","profile_active":"1","profile_disk_usage":"0","profile_name":"tim","profile_private":"1","profile_quota_id":"1","profile_url":"tim","_item_id":"45"},{"_created":"1505533862","_profile_id":"44","_updated":"1505535000","_user_id":"24","profile_active":"1","profile_disk_usage":"0","profile_name":"tim","profile_private":"1","profile_quota_id":"1","profile_url":"tim","_item_id":"44"},{"_app_id":"1","_created":"1505528845","_p23":"2","_profile_id":"43","_updated":"1505535000","_user_id":"","profile_active":"1","profile_disk_usage":"0","profile_name":"tim","profile_private":"1","profile_quota_id":"1","profile_url":"tim","_item_id":"43"},{"_created":"1505528837","_profile_id":"42","_updated":"1505535000","_user_id":"23","profile_active":"1","profile_disk_usage":"0","profile_name":"tim","profile_private":"1","profile_quota_id":"1","profile_url":"tim","_item_id":"42"},{"_app_id":"1","_created":"1505528824","_p22":"2","_profile_id":"41","_updated":"1505535000","_user_id":"","profile_active":"1","profile_disk_usage":"0","profile_name":"tim","profile_private":"1","profile_quota_id":"1","profile_url":"tim","_item_id":"41"},{"_created":"1505528821","_profile_id":"40","_updated":"1505535000","_user_id":"22","profile_active":"1","profile_disk_usage":"0","profile_name":"tim","profile_private":"1","profile_quota_id":"1","profile_url":"tim","_item_id":"40"},{"_app_id":"1","_created":"1505528803","_p21":"2","_profile_id":"39","_updated":"1505535000","_user_id":"","profile_active":"1","profile_disk_usage":"0","profile_name":"tim","profile_private":"1","profile_quota_id":"1","profile_url":"tim","_item_id":"39"},{"_created":"1505528739","_profile_id":"38","_updated":"1505535000","_user_id":"21","profile_active":"1","profile_disk_usage":"0","profile_name":"tim","profile_private":"1","profile_quota_id":"1","profile_url":"tim","_item_id":"38"}],"info":{"limit":10,"total_items":10}}}
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@michael - Not sure how to add the correct "item_index.tpl" to jrProfile Module manually?
We do not want to break the current profiles.
Could you paste in the exact code we should use, and a reminder on how to install it?
michael
@michael
7 years ago
7,744 posts
The profile module does not have an item_index.tpl because you dont list profiles on a profile.

you list audio files that belong to the profile on a profile. You list blog posts of that profile on a profile........ but no profile has a list of profiles on a profile so it doesn't need an item_index.tpl file.

The bridge module is expecting that you're wanting to get things FROM a profile, not PROFILES.

But if you drop an empty file with the file name item_index.tpl into
/modules/jrProfile/templates/item_index.tpl

that hack allows the proxima bridge to work. not great but it works if you really need it.
SoftDesigns
SoftDesigns
@softdesigns
7 years ago
242 posts
@michael - Thanks - It seems working now, we get a list of users.
--
Question: Since this is a bit of a hack, if we upgrade the jrProfile module in future, will that upgrade wipe our item_index.tpl?
michael
@michael
7 years ago
7,744 posts
yes it will wipe your item_index.tpl

Usually to over-ride a module template you put a file in the skin, so try adding
/skins/YOUR SKIN/jrProfile_item_index.tpl

That might work, or try adjusting it from the template editor
ACP -> MODULES -> PROFILE -> PROFILE -> TEMPLATES -> item_index.tpl

That makes the database override work instead of the file system one. Not sure either will work in this case, need to test.

Tags