-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: add users api docs #290
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @luisfelipec95!
|
||
URL: ``/eox-core/api/v1/update-user/`` | ||
|
||
Method: PATCH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we explain the use of EOX_CORE_USER_UPDATE_SAFE_FIELDS
here? Also, could we explain and give an example about updating an extra profile field?
@luisfelipec95 can we rebase this with master to fix the integration tests please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @luisfelipec95!
docs/how_to/users_api.rst
Outdated
"extended_profile_fields": [ "org_name" ] | ||
2. Add org_name to REGISTRATION_EXTRA_FIELDS, indicating whether the field is hidden, optional, or required: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think when people make a field in the setting hidden
, It will not get updated when using the API. Have you tested it? we should explain this
docs/how_to/users_api.rst
Outdated
|
||
If, for example, we want to add the field `Organization name`, we will have to do the following: | ||
|
||
1. Add the field name, `org_name` for example, to `extended_profile_fields`. This indicates that `org_name` will be saved as an extended profile field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Add the field name, `org_name` for example, to `extended_profile_fields`. This indicates that `org_name` will be saved as an extended profile field. | |
1. Add the field name, `org_name` for example, to `extended_profile_fields` setting. This indicates that `org_name` will be saved as an extended profile field. |
docs/how_to/users_api.rst
Outdated
"extended_profile_fields": [ "org_name" ] | ||
2. Add org_name to REGISTRATION_EXTRA_FIELDS, indicating whether the field is hidden, optional, or required: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Add org_name to REGISTRATION_EXTRA_FIELDS, indicating whether the field is hidden, optional, or required: | |
2. Add org_name to `REGISTRATION_EXTRA_FIELDS` setting, ... |
I think we should also highlight better the possible options a field can have
docs/how_to/users_api.rst
Outdated
"org_name": "required" | ||
} | ||
3. In this step, we will create the custom field as a dictionary. In this case, we are going to create a text field for org_name. We must indicate: name, type, and label as the minimum: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3. In this step, we will create the custom field as a dictionary. In this case, we are going to create a text field for org_name. We must indicate: name, type, and label as the minimum: | |
3. Define the custom field by creating it as a dictionary inside the `EDNX_CUSTOM_REGISTRATION_FIELDS` setting. In this case, we are creating a text field for `org_name`. You must specify at least the `name`, `type`, and `label`: |
docs/how_to/users_api.rst
Outdated
"org_name": "required" | ||
} | ||
3. In this step, we will create the custom field as a dictionary. In this case, we are going to create a text field for org_name. We must indicate: name, type, and label as the minimum: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should specify what the possible types are
**Extra Profile Fields** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add a little intro here, I'm thinking something like:
The User API supports the use of extra and custom registration fields for both Create and Update operations. This allows for flexibility in managing user profiles with additional fields beyond the default ones, ensuring that tenants can extend user data as needed.
docs/how_to/users_api.rst
Outdated
|
||
**Tenant settings** | ||
|
||
Add the following settings to the microsite where we want to add the fields: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the following settings to the microsite where we want to add the fields: | |
To add custom or extra registration fields for a specific tenant, you'll need to configure the following settings: |
|
||
**Creating custom registration fields** | ||
|
||
**Tenant settings** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To update an existing extra profile field from the User model like: gender, city, country, etc. Do we need to follow all these steps and configs? if not, can we explain what we will need to do for both cases? in case of an extra field (that already exists), and in the case of a custom field
@luisfelipec95, Could we rebase with master dropping the additional commits? |
docs/how_to/users_api.rst
Outdated
"org_name": "required" | ||
} | ||
|
||
### Note on Hidden Fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text with #
is not rendered correctly.
Co-authored-by: Bryann Valderrama <[email protected]>
Co-authored-by: Bryann Valderrama <[email protected]>
Co-authored-by: Bryann Valderrama <[email protected]>
Co-authored-by: Bryann Valderrama <[email protected]>
Co-authored-by: Bryann Valderrama <[email protected]>
Co-authored-by: Bryann Valderrama <[email protected]>
Co-authored-by: Bryann Valderrama <[email protected]>
Co-authored-by: Bryann Valderrama <[email protected]>
55f6a0b
to
5aa677a
Compare
http://tenant-a.local.edly.io:8000/eox-core/api/v1/user/?username=johndoe | ||
http://tenant-a.local.edly.io:8000/eox-core/api/v1/user/[email protected] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://tenant-a.local.edly.io:8000/eox-core/api/v1/user/?username=johndoe | |
http://tenant-a.local.edly.io:8000/eox-core/api/v1/user/[email protected] | |
POST http://tenant-a.local.edly.io:8000/eox-core/api/v1/user/?username=johndoe | |
POST http://tenant-a.local.edly.io:8000/eox-core/api/v1/user/[email protected] | |
**Note on Hidden Fields** | ||
|
||
Fields that are set as `hidden` in the configuration will not be visible in the registration form or user profile, and they **cannot be updated through the API**. | ||
|
||
If you attempt to update a field that is marked as `hidden` using the API, the update will be ignored, and no changes will be applied to that field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we update the rest of the words with `` to use `` ``.
**Note on Hidden Fields** | |
Fields that are set as `hidden` in the configuration will not be visible in the registration form or user profile, and they **cannot be updated through the API**. | |
If you attempt to update a field that is marked as `hidden` using the API, the update will be ignored, and no changes will be applied to that field. | |
**Note on Hidden Fields** | |
Fields that are set as ``hidden`` in the configuration will not be visible in the registration form or user profile, and they **cannot be updated through the API**. | |
If you attempt to update a field that is marked as ``hidden`` using the API, the update will be ignored, and no changes will be applied to that field. |
Description
This PR adds the user API documentation
Additional information
https://edunext.atlassian.net/browse/AP-1439