As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
So I have just added two unique users to my backend. I am trying to discover one of the users in my test app but I am not seeing anything. I have added a custom ID to each of the users (ex: user.put("UserID", "123456") and I have updated the server). I can see that both these users exist and that the data has been stored in the backend. I am looping through all the ID's(which includes the ones I have given to the user) and am running the following code:
criteria.set(TAG_USER_ID, iFriend.getId());
Gdx.app.log(TAG, "Friend ID " + iFriend.getId().equals("662493754"));
Gdx.app.error(TAG, "failed to fetchByFilterCriteria");
}
where iFriend is a GraphUser(the ID's are facebook ID's). The out put I get "failed to fetchByFilterCriteria" , but when I check the id directly via " iFriend.getId().equals("123456")", it returns true. So why am I not finding the user?
**Also, there is no way to edit a post once you send it or to respond to an answer(like comments). Hopefully that will be updated in the future.
If this is client side code, you can't fetch a user other than yourself. You would need a custom endpoint on the server that does the query for you on the server and returns back the data you need.
E
Ebrahim Behbahani
said
almost 10 years ago
@Daniel: That seems contrary to what the Java guide(http://devcenter.kinvey.com/java/guides/users#lookup) says: "Often times, apps need to share data between users or provide contact information of other users of the app. In such cases, user discovery is a way for your app to retrieve users from the user collection through a query or by fetching all." Also, I have been able to fetch other users using "lookupByFacebookIDBlocking."
D
Daniel Roizman
said
almost 10 years ago
The docs are a bit confusing. But if you keep reading they specify certain attributes you can query against. All of the API's use the same REST API, but if you look at the backbone.js docs, they provide a bit more clarity on the privacy policy. (http://devcenter.kinvey.com/backbone/guides/users#lookup)
E
Ebrahim Behbahani
said
almost 10 years ago
But again, that doesn't make sense. Since it says "User Discovery allows an app to respect user privacy but enable user discovery at the same time." This makes it sound like user discovery is a way around the privacy issues.
Jan 07, 2014 8:54:45 PM com.google.api.client.util.LoggingByteArrayOutputStream close
CONFIG: Total: 162 bytes
Jan 07, 2014 8:54:45 PM com.google.api.client.util.LoggingByteArrayOutputStream close
CONFIG: {"error":"InvalidQuerySyntax","description":"The query string in the request has an invalid syntax","debug":"not allowed to invoke _lookup on attribute UserName"}
SceneSwitchLoadSequence: failed to fetchByFilterCriteria
This when I try to search for the users username that I set via "user.put(UserName, "Name") [update included]." I know that the user exists and that the user name is correct because I can see it in the backend.
E
Edward
said
almost 10 years ago
Hey,
Can you try changing the value of TAG_USER_ID to be `username` instead of `userName`? This error usually occurs because the criteria doesn't exist as a field name, so that might be the issue.
E
Ebrahim Behbahani
said
almost 10 years ago
Yes that worked but it just created more questions. You said this wouldn't work since the fields were not created. See this https://www.dropbox.com/s/rqo1xllbs49afz3/userCP.png . I want to be able to access those fields on any user. "UserName" was a field when I accessed it, but it did not return a result. It seems like only a user id and user name are accessible by other users. Is that correct? Just to outline what I am trying to do. I set a field on a user "userA.put(TEST_FIELD, "userA" );" I update this and now I tell user B to
This should return one user (userA), but it doesn't. So the root of this question is: If I set a value on a user via 'put', can another user access that value?
Here is my output using "UserName":
Jan 16, 2014 10:49:46 AM com.google.api.client.http.HttpRequest execute
CONFIG: -------------- REQUEST --------------
POST https://baas.kinvey.com/user/kid_VVohczrlXM/_lookup
Accept-Encoding: gzip
Authorization:
Content-Type: application/json; charset=UTF-8
User-Agent: android-kinvey-http/2.6.12
x-kinvey-api-version: 3
x-kinvey-device-information: JAVA/1.7.0_45
Content-Type: application/json; charset=UTF-8
Content-Length: 18
Jan 16, 2014 10:49:46 AM com.google.api.client.http.HttpRequest execute
CONFIG: curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'Authorization: ' -H 'Content-Type: application/json; charset=UTF-8' -H 'User-Agent: android-kinvey-http/2.6.12' -H 'x-kinvey-api-version: 3' -H 'x-kinvey-device-information: JAVA/1.7.0_45' -H 'Content-Type: application/json; charset=UTF-8' -d '@-' -- 'https://baas.kinvey.com/user/kid_VVohczrlXM/_lookup' Jan 16, 2014 10:49:46 AM com.google.api.client.util.LoggingByteArrayOutputStream close
CONFIG: Total: 18 bytes
Jan 16, 2014 10:49:46 AM com.google.api.client.util.LoggingByteArrayOutputStream close
CONFIG: {"UserName":"sha"}
Jan 16, 2014 10:49:46 AM com.google.api.client.http.HttpResponse
Jan 16, 2014 10:49:46 AM com.google.api.client.util.LoggingByteArrayOutputStream close
CONFIG: Total: 162 bytes
Jan 16, 2014 10:49:46 AM com.google.api.client.util.LoggingByteArrayOutputStream close
CONFIG: {"error":"InvalidQuerySyntax","description":"The query string in the request has an invalid syntax","debug":"not allowed to invoke _lookup on attribute UserName"}
E
Edward
said
almost 10 years ago
Hey,
by default, we limit the fields that can be used for userlookup. Take a look here for the full list: http://devcenter.kinvey.com/rest/guides/users#lookup
As a workaround, is it possible to merge the `UserName` field and the `username` field?
If that isn't possible, you can also lower the privacy settings on the User collection so that all fields can be used for lookup. Visit: console.kinvey.com/addons/users
and on the left column, click on `settings`. Then, set `Permissions` to `Full`, and try again.
E
Ebrahim Behbahani
said
over 9 years ago
> @Edward said:
> Hey,
>
> by default, we limit the fields that can be used for userlookup. Take a look here for the full list: http://devcenter.kinvey.com/rest/guides/users#lookup
>
> As a workaround, is it possible to merge the `UserName` field and the `username` field?
>
> If that isn't possible, you can also lower the privacy settings on the User collection so that all fields can be used for lookup. Visit: console.kinvey.com/addons/users
>
> and on the left column, click on `settings`. Then, set `Permissions` to `Full`, and try again.
Ok I can work with the user look up limitation , but I still have an issue with getting the data from another user object. Here is the code I use to get a user:
final UserDiscovery users = KinveyClient.userDiscovery();
When I print out the User, I only see these fields: id, username, and social identity. The problem is that I have added more fields with are not visible. I have set permissions to Full and I still see no change. My question is, is it possible for a user to see another users fields (specifically ones that are not on the list you mentioned)?
I can work around this but it is not elegant. I could have every user create a readable file that other users could then read the data off of. I have tested this in another application and it works but in this case it just seems unnecessary.
Ebrahim Behbahani
criteria.set(TAG_USER_ID, iFriend.getId());
Gdx.app.log(TAG, "Friend ID " + iFriend.getId().equals("662493754"));
try {
User[] results = users.lookupBlocking(criteria).execute();
} catch (Exception e) {
Gdx.app.error(TAG, "failed to fetchByFilterCriteria");
}
where iFriend is a GraphUser(the ID's are facebook ID's). The out put I get "failed to fetchByFilterCriteria" , but when I check the id directly via " iFriend.getId().equals("123456")", it returns true. So why am I not finding the user?
**Also, there is no way to edit a post once you send it or to respond to an answer(like comments). Hopefully that will be updated in the future.