Skip to content
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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

luisfelipec95
Copy link
Contributor

@luisfelipec95 luisfelipec95 commented Oct 10, 2024

Description

This PR adds the user API documentation

Additional information

https://edunext.atlassian.net/browse/AP-1439

@luisfelipec95 luisfelipec95 requested a review from a team as a code owner October 10, 2024 22:50
@luisfelipec95 luisfelipec95 marked this pull request as draft October 10, 2024 22:50
@github-actions github-actions bot added size/m and removed size/s labels Oct 11, 2024
@luisfelipec95 luisfelipec95 marked this pull request as ready for review October 11, 2024 22:59
Copy link
Contributor

@BryanttV BryanttV left a 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
Copy link
Contributor

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?

docs/how_to/users_api.rst Show resolved Hide resolved
docs/how_to/users_api.rst Outdated Show resolved Hide resolved
docs/how_to/users_api.rst Outdated Show resolved Hide resolved
docs/how_to/users_api.rst Outdated Show resolved Hide resolved
docs/how_to/users_api.rst Outdated Show resolved Hide resolved
@magajh
Copy link
Contributor

magajh commented Oct 17, 2024

@luisfelipec95 can we rebase this with master to fix the integration tests please?

Copy link
Contributor

@magajh magajh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @luisfelipec95!

"extended_profile_fields": [ "org_name" ]
2. Add org_name to REGISTRATION_EXTRA_FIELDS, indicating whether the field is hidden, optional, or required:
Copy link
Contributor

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


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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

"extended_profile_fields": [ "org_name" ]
2. Add org_name to REGISTRATION_EXTRA_FIELDS, indicating whether the field is hidden, optional, or required:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

"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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`:

"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:
Copy link
Contributor

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**
Copy link
Contributor

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.


**Tenant settings**

Add the following settings to the microsite where we want to add the fields:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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**
Copy link
Contributor

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

@BryanttV
Copy link
Contributor

@luisfelipec95, Could we rebase with master dropping the additional commits?

docs/how_to/users_api.rst Show resolved Hide resolved
"org_name": "required"
}

### Note on Hidden Fields
Copy link
Contributor

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.

docs/how_to/users_api.rst Outdated Show resolved Hide resolved
docs/how_to/users_api.rst Outdated Show resolved Hide resolved
docs/how_to/users_api.rst Outdated Show resolved Hide resolved
docs/how_to/users_api.rst Outdated Show resolved Hide resolved
docs/how_to/users_api.rst Outdated Show resolved Hide resolved
docs/how_to/users_api.rst Show resolved Hide resolved
docs/how_to/users_api.rst Show resolved Hide resolved
docs/how_to/users_api.rst Show resolved Hide resolved
luisfelipec95 and others added 9 commits October 22, 2024 13:20
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]>
Comment on lines +20 to +23
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]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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]

Comment on lines +132 to +136
**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.
Copy link
Contributor

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 `` ``.

Suggested change
**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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants