- Dev notes
- soil-pest-resource-controller
- volunteer-controller
- volunteer-activity-controller
- resource-exchange-controller
- plot-controller
- local-partner-controller
- knowledge-resource-controller
- crop-plan-controller
- community-garden-controller
- user-controller
- role-controller
- weather-controller
- auth-controller
Update a user
PUT
/api/admin/users/{id}
user-controller
Request
Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.Example:
Authorization: Bearer ********************
Path Params
id
integer <int64>
required
Body Params application/json
username
string
optional
email
string
optional
password
string
optional
roleEntities
array[object (RoleEntity) {3}]
optional
id
integer <int64>
optional
name
string
optional
users
array[object (UserEntity) {7}]
optional
Example
{
"username": "string",
"email": "string",
"password": "string",
"roleEntities": [
{
"id": 0,
"name": "string",
"users": [
{
"id": 0,
"username": "string",
"email": "string",
"password": "string",
"roleEntities": [
{}
],
"communityGardens": [
{
"id": 0,
"name": "string",
"location": "string",
"sunlight": "string",
"soilType": "string",
"users": [
{}
],
"plots": [
{
"id": 0,
"plotName": "string",
"sunlight": "string",
"soilType": "string",
"communityGarden": {}
}
]
}
],
"volunteerActivity": {
"id": 0,
"activityName": "string",
"date": "2019-08-24T14:15:22Z",
"description": "string",
"users": [
{}
],
"volunteers": [
{
"id": 0,
"name": "string",
"contactInfo": "string",
"skills": "string",
"availability": "string",
"activities": [
{}
]
}
]
}
}
]
}
]
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT '/api/admin/users/' \
--header 'Content-Type: application/json' \
--data-raw '{
"username": "string",
"email": "string",
"password": "string",
"roleEntities": [
{
"id": 0,
"name": "string",
"users": [
{
"id": 0,
"username": "string",
"email": "string",
"password": "string",
"roleEntities": [
{}
],
"communityGardens": [
{
"id": 0,
"name": "string",
"location": "string",
"sunlight": "string",
"soilType": "string",
"users": [
{}
],
"plots": [
{
"id": 0,
"plotName": "string",
"sunlight": "string",
"soilType": "string",
"communityGarden": {}
}
]
}
],
"volunteerActivity": {
"id": 0,
"activityName": "string",
"date": "2019-08-24T14:15:22Z",
"description": "string",
"users": [
{}
],
"volunteers": [
{
"id": 0,
"name": "string",
"contactInfo": "string",
"skills": "string",
"availability": "string",
"activities": [
{}
]
}
]
}
}
]
}
]
}'
Responses
🟢200User updated successfully
application/json
Body
id
integer <int64>
optional
username
string
optional
email
string
optional
roleEntities
array[object (RoleDTO) {2}]
optional
id
integer <int64>
optional
name
string
optional
communityGardens
array[object (CommunityGardenDTos) {2}]
optional
id
integer <int64>
optional
name
string
optional
volunteerActivity
object (VolunteerActivityDTos)
optional
id
integer <int64>
optional
activityName
string
optional
Example
{
"id": 0,
"username": "string",
"email": "string",
"roleEntities": [
{
"id": 0,
"name": "string"
}
],
"communityGardens": [
{
"id": 0,
"name": "string"
}
],
"volunteerActivity": {
"id": 0,
"activityName": "string"
}
}
🟠400Invalid input
🟠404User not found
🔴500Internal Server Error
Modified at 2024-06-11 16:24:49