Forum Discussion

MusterBuster's avatar
14 years ago

REST API calls that edit Profile information?

Hey Lithosphere!

 

It's been a while ;)

 

I'm looking into running a community event over on the PlayStation forums which would see a zombie virus spreading through the community. The idea being that if a user makes a post in a certain thread or board - or even clicks a big, shiny, red button - they would become infected by this virus. The user would then be able to identify that they have been infected and the community team would be able to pull out a list of infected users and contact them about their "infection" (quiet in the back!).

 

What I'm looking for then is a REST API call that would enable us to write a specific phrase to the user's Profile Bio, which can be searched for in the User Search option of the forum. Or better, some other way of automatically writing information to the user's profile which we can then use to identify the "infected" users in a search or report.

 

Any ideas?

 

MB

  • JakeR's avatar
    JakeR
    Khoros Oracle

    Welcome back, MusterBuster.  Long time no see! :)

     

    Thanks for explaining the business story.  It really helps put into perspective what we can help you accomplish.  It also happens to be a clever little idea, so Kudos to you for that.  Heheh.

     

    Unfortunately, there is not REST API call to write into a user's biography.  However, you can use the SSO token to populate this info.  When the user logs in, the token will update with the info you pass over.  The field in the token that we will respond to (and update) is called:

     

    profile.biography (there is likely a 10,000 character limit - but I dont know that for certain)

     

    The next trick that you're going to want to pull is using some kind of search criteria that will yield only your "infected" users when doing a user search.

     

    Fortunately, we know that if you use a word in User Search that only appears in a biography, it will yield results.

     

    For example, in my biography, I have the word "junkie" (and no, its not what you think, heheh!).  So if you do a user search on the Lithosphere, and your search term is "junkie" it will bring up the JakeR profile.  So we know that a User Search will query the biographies of users.

     

    So there is a way to update a user's biography, but it is done via their SSO token rather than the API.  And once the biography has been updated with the right "infected" information, it is possible to create a list of those users that are "infected" via a User Search.

     

    • luk's avatar
      luk
      Boss

      I know this one is very old, but found it trough search, maybe it helps somebody. What JakeR wrote 9 years (lol) ago does not apply anymore, I just confirmed that I'm able to write a user's bio with API v1 trough the following query:

      restadmin('/users/id/<user_id>/profiles/name/biography/set?value=test')

    • Thanks for that Jake, I'll look into this and let you know if it's workable :)