Welcome Profile Info.*
Welcome Profile Info
This feature present user with set of steps(questions) user needs to answer after registration. User is not able to continue using website until all steps are completed. Steps are: first name, question, description, headline, photo. First name is responsible for setting user's first_name, description - user's description, headline user's title(headline), question contains set of profile info questions(ones that are used in profile edit, just grouped differently).
To figure out whether user is free to use website(or has uncompleted steps), we use status flag, that can be default, complete, incomplete. Default is default flag, marks user registered before feature implemented, or website doesn't support feature, complete - user completed all steps, incomplete - user needs to complete all steps before using website. We set user to status incomplete after registration, and to status complete after completion, user with status incomplete can't continue to use website..
API commands
We have API commands to get/update steps data, and get/update status flag. Description follows.
welcome_profile_info.get-data
parameters
- None. Requires logged in user.
example
https://front-m1.dvipdev.com/api.json?cmd=welcome_profile_info.get-data
result
{ "meta": { "status": "OK" }, "result": { "data": { "firstname": { "answered": "third dude" }, "headline": { "answered": "third dude" }, "description": { "answered": "third dude" }, "question": { "q_0": { "group_id": "0", "question_id": 0, "question_name": "What are you looking for?", "answers": { "1": "Hang out", "2": "Talk \/ email", "3": "Long term relationship", "4": "Dating", "5": "Friends", "6": "Intimate encounter", "7": "Activity partner", "8": "Other relationship" }, "answered": [ "6", "8" ], "multiselect": "1", "type": "select", "value_min": "0", "value_max": "0" }, "q_34": { "question_id": "34", "group_id": "5", "type": "select", "value_min": "0", "value_max": "0", "multiselect": "0", "question_name": "Do you smoke?", "answers": { "345": "Don't smoke", "346": "Quitting smoking", "347": "Smoke socially", "348": "Smoke regularly (5-10 a day)", "349": "Smoke heavily (10+ a day)" }, "answered": [ "345" ] }, "q_24": { "question_id": "24", "group_id": "4", "type": "check", "value_min": "0", "value_max": "0", "multiselect": "1", "question_name": "What do you watch on TV?", "answers": { "235": "News", "236": "Cartoons", "237": "Documentaries", "238": "Dramas", "239": "Situation comedies", "240": "Instructional", "241": "Movies", "242": "I don't like TV", "243": "I wish I had a TV", "244": "Sports", "245": "Reality shows", "246": "Soaps", "247": "Re-runs" }, "answered": [ "240", "241", "247" ] }, "q_29": { "question_id": "29", "group_id": "4", "type": "char", "value_min": "0", "value_max": "80", "multiselect": "0", "question_name": "My favorite artists are:", "answered": [ "some great artist" ] } } } } }
result description
- firstname: handles first name step
- answered: user's current first name
- description: handles description step
- answered: user's current
- headline: handles headline step
- answered: user's current headline
- question: handles question steps, this step is set of a few steps
- answered: users current first name
- question_id: question ident, needed for update
- group_id: question belongs to this profile info group(not really needed here, but useful for quick checks(defines db table name))
- type: type of question. Can be select, check, char, text, float, int. We do not use exact representation, but in general select is select box, check is set of checkboxes/radio buttons(depending on multiselect), char and text are text boxes(char limited length), float/int are numeric with different step, etc. For this feature we represent(driven by design) select/check as a custom select(bubbles), char/text are text areas, float/int numeric.
- value_min: important for float/int/char, min value or min number of chars
- value_max: important for float/int/char, max value or max number of chars
- multiselect: important for select/check, can user pick more answers or just one
- question_name: text to be displayed as question, translated
- answered: array of current answers
welcome_profile_info.update-data
parameters
- what: which step we're updating. Can be [firstname, description, headline, question]
- value: new value for given property
- id: only valid when what=question, question_id of question we're updating
example
https://front-m1.dvipdev.com/api.json?cmd=welcome_profile_info.update-data&what=firstname&value=this_is_my_first_name
https://front-m1.dvipdev.com/api.json?cmd=welcome_profile_info.update-data&what=description&value=this_is_my_description
https://front-m1.dvipdev.com/api.json?cmd=welcome_profile_info.update-data&what=headline&value=this_is_my_headline
https://front-m1.dvipdev.com/api.json?cmd=welcome_profile_info.update-data&what=question&id=24&value=235,236,237
https://front-m1.dvipdev.com/api.json?cmd=welcome_profile_info.update-data&what=question&id=29&value=some_great_artist
result
{ "meta": { "status": "OK" }, "result": { "success": true } }
result description
- success: whether we have successfully updated property
welcome_profile_info.get-status
parameters
- None, Requires logged in user.
example
https://front-m1.dvipdev.com/api.json?cmd=welcome_profile_info.get-status
result
{ "meta": { "status": "OK" }, "result": { "status": 1 } }
result description
- status: current status flag. Can be one of the [0 - default, 1 - complete, 2 - incomplete]
welcome_profile_info.update-status
parameters
- value: new value for status flag.Can be one of the [0 - default, 1 - complete, 2 - incomplete]
example
https://front-m1.dvipdev.com/api.json?cmd=welcome_profile_info.update-status&value=2
result
{ "meta": { "status": "OK" }, "result": { "success": true } }
result description
- success: was status update successful?
- Last Author
- asimic
- Last Edited
- Apr 15 2020, 14:26