How to add or modify "additional user data" after user is created

0 votes
I see in the docs that you can save additional user data using addJSONObject() followed by createUser().  But I'm wanting to allow players to specify their own nickname that will be associated with their user account (which will be under their Facebook user ID), and I want to store this as "additional data" associated with the user's account.

Is there a way to add or modify this additional information after the user's account has already been created?

Judging from the fact that you must specify a collection, am I right in assuming this means the data can be accessed and modified like any JSON document?  Please help me understand how this works.  Thanks!
asked Jul 10, 2014 in App42PaaS & BPaaS by Brady Wright (35 points)

1 Answer

0 votes
 
Best answer

Hi Brady,

Thanks for writing to us.

To update information of already created user, you can use CreateOrUpdateProfile function. If you want to add more information other than profile info then you can  use addJSONObject function followed by CreateOrUpdateProfile function.

Yes the information you will save in user object will be saved in the form of json and you can access or modify it using storage service.

Let me know if it answers your question.

Thanks

answered Jul 11, 2014 by hs00105 (517 points)
selected Jul 16, 2014 by Brady Wright
So just to clarify, let me ask four clarifying questions:

1) Using the CreateOrUpdateProfile() technique, I would want to take the following steps?
* Obtain a user object (probably using getUser())
* Obtain a profile object containing the user's current profile data (see question #2)
* call addJSONObject() passing it the additional, non-profile user data
* The finally call CreateOrUpdateProfile()?

2) How do I retrieve a user's profile information?  I'm unable to find an API that seems like that's what it does.

3) Instead of using CreateOrUpdateProfile() or createUser(), could I simply use the StorageService APIs to store this information?  But if I did, it wouldn't be associated with the specific user account would it?

4) Once the additional information is stored for that user, how do I retrieve it?  I'm assuming the point of it is that it is associated with the user's account, but in what way is it associated since it seems to just go into a storage table?

Thanks!
Regarding #2, I found that the User object contains APIs for retrieving this information, so that's answered.

#4 is still the most pressing question.  How do I retrieve the additional information for a user once it is stored using CreateOrUpdateProfile()?  Is the StorageService API the only way?
Okay, I found the API for fetching additional user data:
http://api.shephertz.com/app42-docs/user-management-service/#fetch-additional-data-of-user

Not sure why I didn't see it in the index before.  Thanks!
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...